From 0f78c346806d81a477c2d943942fa6e4e5eece12 Mon Sep 17 00:00:00 2001 From: Matthias Frei Date: Fri, 3 Nov 2023 09:12:00 +0100 Subject: [PATCH] deps: update oapi-codegen to v2 (#4432) The oapi-codegen libraries went through a reorganization; the repositories for the oapi-codegen build tool was separated from the runtime libraries. In our normal code dependencies, the oapi-codegen build tool no longer shows up. Import it in a dummy .go file as an easy way to ensure that we have all the appropriate dependencies (via the `go.mod`/`go_deps.bzl`) . This leaves some clutter in the `go.mod` file which is not aesthetically pleasing, but is not a real issue due to dependency graph pruning. The alternative solution would have been to manage the dependencies of the `rules_openapi` bazel rules explicitly in a `rules_openapi_dependencies` macro. This turns out to be rather cumbersome, and can lead to unexpected or even invalid dependency version combinations, because `rules_go` does not have a way to separate the dependencies of the build tools from the dependencies of the code. Aside; fix `cfg = "exec"` for the oapi-codegen buildtool so that this tool is built for the environment of the builder, not the target platform. --- control/mgmtapi/BUILD.bazel | 3 +- control/mgmtapi/client.gen.go | 506 +++++++++--------- control/mgmtapi/server.gen.go | 224 ++++++-- control/mgmtapi/spec.gen.go | 12 +- daemon/mgmtapi/BUILD.bazel | 2 +- daemon/mgmtapi/client.gen.go | 288 +++++----- daemon/mgmtapi/server.gen.go | 144 +++-- daemon/mgmtapi/spec.gen.go | 12 +- dispatcher/mgmtapi/client.gen.go | 26 +- dispatcher/mgmtapi/server.gen.go | 52 +- dispatcher/mgmtapi/spec.gen.go | 12 +- gateway/mgmtapi/BUILD.bazel | 2 +- gateway/mgmtapi/client.gen.go | 26 +- gateway/mgmtapi/server.gen.go | 52 +- gateway/mgmtapi/spec.gen.go | 12 +- go.mod | 25 +- go.sum | 55 +- go_deps.bzl | 316 ++++++++--- .../LICENSE | 0 .../data/com_github_labstack_echo_v4/LICENSE | 21 - .../data/com_github_labstack_gommon/LICENSE | 22 - .../com_github_oapi_codegen_runtime/LICENSE | 201 +++++++ .../com_github_valyala_bytebufferpool/LICENSE | 22 - .../com_github_valyala_fasttemplate/LICENSE | 22 - nogo.json | 7 +- private/ca/api/BUILD.bazel | 4 +- private/ca/api/client.gen.go | 96 ++-- private/ca/api/types.gen.go | 28 +- private/mgmtapi/cppki/api/BUILD.bazel | 2 +- private/mgmtapi/cppki/api/client.gen.go | 178 +++--- private/mgmtapi/cppki/api/server.gen.go | 74 ++- private/mgmtapi/health/api/client.gen.go | 6 +- private/mgmtapi/health/api/server.gen.go | 22 +- private/mgmtapi/segments/api/BUILD.bazel | 2 +- private/mgmtapi/segments/api/client.gen.go | 86 +-- private/mgmtapi/segments/api/server.gen.go | 44 +- router/mgmtapi/BUILD.bazel | 3 +- router/mgmtapi/client.gen.go | 38 +- router/mgmtapi/server.gen.go | 62 ++- router/mgmtapi/spec.gen.go | 12 +- rules_openapi/internal/generate.bzl | 4 +- rules_openapi/internal/tools.go | 24 + 42 files changed, 1741 insertions(+), 1008 deletions(-) rename licenses/data/{com_github_deepmap_oapi_codegen => com_github_deepmap_oapi_codegen_v2}/LICENSE (100%) delete mode 100644 licenses/data/com_github_labstack_echo_v4/LICENSE delete mode 100644 licenses/data/com_github_labstack_gommon/LICENSE create mode 100644 licenses/data/com_github_oapi_codegen_runtime/LICENSE delete mode 100644 licenses/data/com_github_valyala_bytebufferpool/LICENSE delete mode 100644 licenses/data/com_github_valyala_fasttemplate/LICENSE create mode 100644 rules_openapi/internal/tools.go diff --git a/control/mgmtapi/BUILD.bazel b/control/mgmtapi/BUILD.bazel index 20d657d1ea..71202371ec 100644 --- a/control/mgmtapi/BUILD.bazel +++ b/control/mgmtapi/BUILD.bazel @@ -42,10 +42,9 @@ go_library( "//private/mgmtapi/segments/api:go_default_library", "//private/storage:go_default_library", "//private/storage/beacon:go_default_library", - "@com_github_deepmap_oapi_codegen//pkg/runtime:go_default_library", # keep "@com_github_getkin_kin_openapi//openapi3:go_default_library", # keep "@com_github_go_chi_chi_v5//:go_default_library", # keep - "@com_github_pkg_errors//:go_default_library", # keep + "@com_github_oapi_codegen_runtime//:go_default_library", # keep "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/control/mgmtapi/client.gen.go b/control/mgmtapi/client.gen.go index bcc8495fa6..c024fae2f1 100644 --- a/control/mgmtapi/client.gen.go +++ b/control/mgmtapi/client.gen.go @@ -13,7 +13,7 @@ import ( "net/url" "strings" - "github.com/deepmap/oapi-codegen/pkg/runtime" + "github.com/oapi-codegen/runtime" ) // RequestEditorFn is the function signature for the RequestEditor callback function @@ -122,7 +122,7 @@ type ClientInterface interface { // GetLogLevel request GetLogLevel(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // SetLogLevel request with any body + // SetLogLevelWithBody request with any body SetLogLevelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) SetLogLevel(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -438,122 +438,124 @@ func NewGetBeaconsRequest(server string, params *GetBeaconsParams) (*http.Reques return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.StartIsdAs != nil { + if params.StartIsdAs != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_isd_as", runtime.ParamLocationQuery, *params.StartIsdAs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_isd_as", runtime.ParamLocationQuery, *params.StartIsdAs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - if params.Usages != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "usages", runtime.ParamLocationQuery, *params.Usages); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.Usages != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "usages", runtime.ParamLocationQuery, *params.Usages); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - if params.IngressInterface != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ingress_interface", runtime.ParamLocationQuery, *params.IngressInterface); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.IngressInterface != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ingress_interface", runtime.ParamLocationQuery, *params.IngressInterface); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - } - - if params.ValidAt != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "valid_at", runtime.ParamLocationQuery, *params.ValidAt); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.ValidAt != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "valid_at", runtime.ParamLocationQuery, *params.ValidAt); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - if params.All != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.All != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - if params.Desc != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "desc", runtime.ParamLocationQuery, *params.Desc); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.Desc != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "desc", runtime.ParamLocationQuery, *params.Desc); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - } - - if params.Sort != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort", runtime.ParamLocationQuery, *params.Sort); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.Sort != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort", runtime.ParamLocationQuery, *params.Sort); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -676,58 +678,60 @@ func NewGetCertificatesRequest(server string, params *GetCertificatesParams) (*h return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.IsdAs != nil { + if params.IsdAs != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "isd_as", runtime.ParamLocationQuery, *params.IsdAs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "isd_as", runtime.ParamLocationQuery, *params.IsdAs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - } - - if params.ValidAt != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "valid_at", runtime.ParamLocationQuery, *params.ValidAt); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.ValidAt != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "valid_at", runtime.ParamLocationQuery, *params.ValidAt); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - if params.All != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.All != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -971,42 +975,44 @@ func NewGetSegmentsRequest(server string, params *GetSegmentsParams) (*http.Requ return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.StartIsdAs != nil { + if params.StartIsdAs != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_isd_as", runtime.ParamLocationQuery, *params.StartIsdAs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_isd_as", runtime.ParamLocationQuery, *params.StartIsdAs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - if params.EndIsdAs != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_isd_as", runtime.ParamLocationQuery, *params.EndIsdAs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.EndIsdAs != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_isd_as", runtime.ParamLocationQuery, *params.EndIsdAs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -1183,42 +1189,44 @@ func NewGetTrcsRequest(server string, params *GetTrcsParams) (*http.Request, err return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.Isd != nil { + if params.Isd != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", false, "isd", runtime.ParamLocationQuery, *params.Isd); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", false, "isd", runtime.ParamLocationQuery, *params.Isd); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - } - - if params.All != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.All != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -1366,69 +1374,69 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetBeacons request + // GetBeaconsWithResponse request GetBeaconsWithResponse(ctx context.Context, params *GetBeaconsParams, reqEditors ...RequestEditorFn) (*GetBeaconsResponse, error) - // GetBeacon request + // GetBeaconWithResponse request GetBeaconWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetBeaconResponse, error) - // GetBeaconBlob request + // GetBeaconBlobWithResponse request GetBeaconBlobWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetBeaconBlobResponse, error) - // GetCa request + // GetCaWithResponse request GetCaWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCaResponse, error) - // GetCertificates request + // GetCertificatesWithResponse request GetCertificatesWithResponse(ctx context.Context, params *GetCertificatesParams, reqEditors ...RequestEditorFn) (*GetCertificatesResponse, error) - // GetCertificate request + // GetCertificateWithResponse request GetCertificateWithResponse(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*GetCertificateResponse, error) - // GetCertificateBlob request + // GetCertificateBlobWithResponse request GetCertificateBlobWithResponse(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*GetCertificateBlobResponse, error) - // GetConfig request + // GetConfigWithResponse request GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error) - // GetHealth request + // GetHealthWithResponse request GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error) - // GetInfo request + // GetInfoWithResponse request GetInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInfoResponse, error) - // GetLogLevel request + // GetLogLevelWithResponse request GetLogLevelWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLogLevelResponse, error) - // SetLogLevel request with any body + // SetLogLevelWithBodyWithResponse request with any body SetLogLevelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error) SetLogLevelWithResponse(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error) - // GetSegments request + // GetSegmentsWithResponse request GetSegmentsWithResponse(ctx context.Context, params *GetSegmentsParams, reqEditors ...RequestEditorFn) (*GetSegmentsResponse, error) - // GetSegment request + // GetSegmentWithResponse request GetSegmentWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetSegmentResponse, error) - // GetSegmentBlob request + // GetSegmentBlobWithResponse request GetSegmentBlobWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetSegmentBlobResponse, error) - // GetSigner request + // GetSignerWithResponse request GetSignerWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSignerResponse, error) - // GetSignerChain request + // GetSignerChainWithResponse request GetSignerChainWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSignerChainResponse, error) - // GetTopology request + // GetTopologyWithResponse request GetTopologyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTopologyResponse, error) - // GetTrcs request + // GetTrcsWithResponse request GetTrcsWithResponse(ctx context.Context, params *GetTrcsParams, reqEditors ...RequestEditorFn) (*GetTrcsResponse, error) - // GetTrc request + // GetTrcWithResponse request GetTrcWithResponse(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*GetTrcResponse, error) - // GetTrcBlob request + // GetTrcBlobWithResponse request GetTrcBlobWithResponse(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*GetTrcBlobResponse, error) } @@ -1438,7 +1446,7 @@ type GetBeaconsResponse struct { JSON200 *struct { Beacons *[]Beacon `json:"beacons,omitempty"` } - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1461,7 +1469,7 @@ type GetBeaconResponse struct { Body []byte HTTPResponse *http.Response JSON200 *BeaconGetResponseJson - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1483,7 +1491,7 @@ func (r GetBeaconResponse) StatusCode() int { type GetBeaconBlobResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1506,7 +1514,7 @@ type GetCaResponse struct { Body []byte HTTPResponse *http.Response JSON200 *CA - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1526,10 +1534,10 @@ func (r GetCaResponse) StatusCode() int { } type GetCertificatesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]ChainBrief - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *[]ChainBrief + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -1549,10 +1557,10 @@ func (r GetCertificatesResponse) StatusCode() int { } type GetCertificateResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Chain - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *Chain + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -1572,9 +1580,9 @@ func (r GetCertificateResponse) StatusCode() int { } type GetCertificateBlobResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -1596,7 +1604,7 @@ func (r GetCertificateBlobResponse) StatusCode() int { type GetConfigResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1619,7 +1627,7 @@ type GetHealthResponse struct { Body []byte HTTPResponse *http.Response JSON200 *HealthResponse - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1641,7 +1649,7 @@ func (r GetHealthResponse) StatusCode() int { type GetInfoResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1664,7 +1672,7 @@ type GetLogLevelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LogLevel - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1687,7 +1695,7 @@ type SetLogLevelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LogLevel - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1707,10 +1715,10 @@ func (r SetLogLevelResponse) StatusCode() int { } type GetSegmentsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]SegmentBrief - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *[]SegmentBrief + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -1730,10 +1738,10 @@ func (r GetSegmentsResponse) StatusCode() int { } type GetSegmentResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Segment - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *Segment + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -1753,9 +1761,9 @@ func (r GetSegmentResponse) StatusCode() int { } type GetSegmentBlobResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -1778,7 +1786,7 @@ type GetSignerResponse struct { Body []byte HTTPResponse *http.Response JSON200 *Signer - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1800,7 +1808,7 @@ func (r GetSignerResponse) StatusCode() int { type GetSignerChainResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1823,7 +1831,7 @@ type GetTopologyResponse struct { Body []byte HTTPResponse *http.Response JSON200 *Topology - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1846,7 +1854,7 @@ type GetTrcsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *[]TRCBrief - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1869,7 +1877,7 @@ type GetTrcResponse struct { Body []byte HTTPResponse *http.Response JSON200 *TRC - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1891,7 +1899,7 @@ func (r GetTrcResponse) StatusCode() int { type GetTrcBlobResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -2131,7 +2139,7 @@ func ParseGetBeaconsResponse(rsp *http.Response) (*GetBeaconsResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2164,7 +2172,7 @@ func ParseGetBeaconResponse(rsp *http.Response) (*GetBeaconResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2190,7 +2198,7 @@ func ParseGetBeaconBlobResponse(rsp *http.Response) (*GetBeaconBlobResponse, err switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2223,7 +2231,7 @@ func ParseGetCaResponse(rsp *http.Response) (*GetCaResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2260,7 +2268,7 @@ func ParseGetCertificatesResponse(rsp *http.Response) (*GetCertificatesResponse, if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -2293,7 +2301,7 @@ func ParseGetCertificateResponse(rsp *http.Response) (*GetCertificateResponse, e if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -2319,7 +2327,7 @@ func ParseGetCertificateBlobResponse(rsp *http.Response) (*GetCertificateBlobRes if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -2341,7 +2349,7 @@ func ParseGetConfigResponse(rsp *http.Response) (*GetConfigResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2374,7 +2382,7 @@ func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2400,7 +2408,7 @@ func ParseGetInfoResponse(rsp *http.Response) (*GetInfoResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2433,7 +2441,7 @@ func ParseGetLogLevelResponse(rsp *http.Response) (*GetLogLevelResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2466,7 +2474,7 @@ func ParseSetLogLevelResponse(rsp *http.Response) (*SetLogLevelResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2503,7 +2511,7 @@ func ParseGetSegmentsResponse(rsp *http.Response) (*GetSegmentsResponse, error) if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -2536,7 +2544,7 @@ func ParseGetSegmentResponse(rsp *http.Response) (*GetSegmentResponse, error) { if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -2562,7 +2570,7 @@ func ParseGetSegmentBlobResponse(rsp *http.Response) (*GetSegmentBlobResponse, e if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -2591,7 +2599,7 @@ func ParseGetSignerResponse(rsp *http.Response) (*GetSignerResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2617,7 +2625,7 @@ func ParseGetSignerChainResponse(rsp *http.Response) (*GetSignerChainResponse, e switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2650,7 +2658,7 @@ func ParseGetTopologyResponse(rsp *http.Response) (*GetTopologyResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2683,7 +2691,7 @@ func ParseGetTrcsResponse(rsp *http.Response) (*GetTrcsResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2716,7 +2724,7 @@ func ParseGetTrcResponse(rsp *http.Response) (*GetTrcResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2742,7 +2750,7 @@ func ParseGetTrcBlobResponse(rsp *http.Response) (*GetTrcBlobResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/control/mgmtapi/server.gen.go b/control/mgmtapi/server.gen.go index d30513ea9d..1419a33f3a 100644 --- a/control/mgmtapi/server.gen.go +++ b/control/mgmtapi/server.gen.go @@ -7,8 +7,8 @@ import ( "fmt" "net/http" - "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/go-chi/chi/v5" + "github.com/oapi-codegen/runtime" ) // ServerInterface represents all server handlers. @@ -78,6 +78,136 @@ type ServerInterface interface { GetTrcBlob(w http.ResponseWriter, r *http.Request, isd int, base int, serial int) } +// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. + +type Unimplemented struct{} + +// List the SCION beacons +// (GET /beacons) +func (_ Unimplemented) GetBeacons(w http.ResponseWriter, r *http.Request, params GetBeaconsParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the SCION beacon description +// (GET /beacons/{segment-id}) +func (_ Unimplemented) GetBeacon(w http.ResponseWriter, r *http.Request, segmentId SegmentID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the SCION beacon blob +// (GET /beacons/{segment-id}/blob) +func (_ Unimplemented) GetBeaconBlob(w http.ResponseWriter, r *http.Request, segmentId SegmentID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Information about the CA. +// (GET /ca) +func (_ Unimplemented) GetCa(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// List the certificate chains +// (GET /certificates) +func (_ Unimplemented) GetCertificates(w http.ResponseWriter, r *http.Request, params GetCertificatesParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the certificate chain +// (GET /certificates/{chain-id}) +func (_ Unimplemented) GetCertificate(w http.ResponseWriter, r *http.Request, chainId ChainID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the certificate chain blob +// (GET /certificates/{chain-id}/blob) +func (_ Unimplemented) GetCertificateBlob(w http.ResponseWriter, r *http.Request, chainId ChainID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Prints the TOML configuration file. +// (GET /config) +func (_ Unimplemented) GetConfig(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Indicate the service health. +// (GET /health) +func (_ Unimplemented) GetHealth(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Basic information page about the control service process. +// (GET /info) +func (_ Unimplemented) GetInfo(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get logging level +// (GET /log/level) +func (_ Unimplemented) GetLogLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set logging level +// (PUT /log/level) +func (_ Unimplemented) SetLogLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// List the SCION path segments +// (GET /segments) +func (_ Unimplemented) GetSegments(w http.ResponseWriter, r *http.Request, params GetSegmentsParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the SCION path segment description +// (GET /segments/{segment-id}) +func (_ Unimplemented) GetSegment(w http.ResponseWriter, r *http.Request, segmentId SegmentID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the SCION path segment blob +// (GET /segments/{segment-id}/blob) +func (_ Unimplemented) GetSegmentBlob(w http.ResponseWriter, r *http.Request, segmentId SegmentID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Prints information about the AS Certificate used to sign the control-plane message. +// (GET /signer) +func (_ Unimplemented) GetSigner(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the certificate chain blob +// (GET /signer/blob) +func (_ Unimplemented) GetSignerChain(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Prints the contents of the AS topology file. +// (GET /topology) +func (_ Unimplemented) GetTopology(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// List the TRCs +// (GET /trcs) +func (_ Unimplemented) GetTrcs(w http.ResponseWriter, r *http.Request, params GetTrcsParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the TRC +// (GET /trcs/isd{isd}-b{base}-s{serial}) +func (_ Unimplemented) GetTrc(w http.ResponseWriter, r *http.Request, isd int, base int, serial int) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the TRC blob +// (GET /trcs/isd{isd}-b{base}-s{serial}/blob) +func (_ Unimplemented) GetTrcBlob(w http.ResponseWriter, r *http.Request, isd int, base int, serial int) { + w.WriteHeader(http.StatusNotImplemented) +} + // ServerInterfaceWrapper converts contexts to parameters. type ServerInterfaceWrapper struct { Handler ServerInterface @@ -152,9 +282,9 @@ func (siw *ServerInterfaceWrapper) GetBeacons(w http.ResponseWriter, r *http.Req return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetBeacons(w, r, params) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -178,9 +308,9 @@ func (siw *ServerInterfaceWrapper) GetBeacon(w http.ResponseWriter, r *http.Requ return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetBeacon(w, r, segmentId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -204,9 +334,9 @@ func (siw *ServerInterfaceWrapper) GetBeaconBlob(w http.ResponseWriter, r *http. return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetBeaconBlob(w, r, segmentId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -219,9 +349,9 @@ func (siw *ServerInterfaceWrapper) GetBeaconBlob(w http.ResponseWriter, r *http. func (siw *ServerInterfaceWrapper) GetCa(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetCa(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -263,9 +393,9 @@ func (siw *ServerInterfaceWrapper) GetCertificates(w http.ResponseWriter, r *htt return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetCertificates(w, r, params) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -289,9 +419,9 @@ func (siw *ServerInterfaceWrapper) GetCertificate(w http.ResponseWriter, r *http return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetCertificate(w, r, chainId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -315,9 +445,9 @@ func (siw *ServerInterfaceWrapper) GetCertificateBlob(w http.ResponseWriter, r * return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetCertificateBlob(w, r, chainId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -330,9 +460,9 @@ func (siw *ServerInterfaceWrapper) GetCertificateBlob(w http.ResponseWriter, r * func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetConfig(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -345,9 +475,9 @@ func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Requ func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetHealth(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -360,9 +490,9 @@ func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Requ func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetInfo(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -375,9 +505,9 @@ func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Reques func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetLogLevel(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -390,9 +520,9 @@ func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Re func (siw *ServerInterfaceWrapper) SetLogLevel(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.SetLogLevel(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -426,9 +556,9 @@ func (siw *ServerInterfaceWrapper) GetSegments(w http.ResponseWriter, r *http.Re return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSegments(w, r, params) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -452,9 +582,9 @@ func (siw *ServerInterfaceWrapper) GetSegment(w http.ResponseWriter, r *http.Req return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSegment(w, r, segmentId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -478,9 +608,9 @@ func (siw *ServerInterfaceWrapper) GetSegmentBlob(w http.ResponseWriter, r *http return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSegmentBlob(w, r, segmentId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -493,9 +623,9 @@ func (siw *ServerInterfaceWrapper) GetSegmentBlob(w http.ResponseWriter, r *http func (siw *ServerInterfaceWrapper) GetSigner(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSigner(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -508,9 +638,9 @@ func (siw *ServerInterfaceWrapper) GetSigner(w http.ResponseWriter, r *http.Requ func (siw *ServerInterfaceWrapper) GetSignerChain(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSignerChain(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -523,9 +653,9 @@ func (siw *ServerInterfaceWrapper) GetSignerChain(w http.ResponseWriter, r *http func (siw *ServerInterfaceWrapper) GetTopology(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetTopology(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -559,9 +689,9 @@ func (siw *ServerInterfaceWrapper) GetTrcs(w http.ResponseWriter, r *http.Reques return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetTrcs(w, r, params) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -603,9 +733,9 @@ func (siw *ServerInterfaceWrapper) GetTrc(w http.ResponseWriter, r *http.Request return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetTrc(w, r, isd, base, serial) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -647,9 +777,9 @@ func (siw *ServerInterfaceWrapper) GetTrcBlob(w http.ResponseWriter, r *http.Req return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetTrcBlob(w, r, isd, base, serial) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -671,16 +801,16 @@ func (e *UnescapedCookieParamError) Unwrap() error { return e.Err } -type UnmarshallingParamError struct { +type UnmarshalingParamError struct { ParamName string Err error } -func (e *UnmarshallingParamError) Error() string { - return fmt.Sprintf("Error unmarshalling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) } -func (e *UnmarshallingParamError) Unwrap() error { +func (e *UnmarshalingParamError) Unwrap() error { return e.Err } diff --git a/control/mgmtapi/spec.gen.go b/control/mgmtapi/spec.gen.go index 8a9c4b2f0a..58488deea5 100644 --- a/control/mgmtapi/spec.gen.go +++ b/control/mgmtapi/spec.gen.go @@ -100,16 +100,16 @@ var swaggerSpec = []string{ func decodeSpec() ([]byte, error) { zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %s", err) + return nil, fmt.Errorf("error base64 decoding spec: %w", err) } zr, err := gzip.NewReader(bytes.NewReader(zipped)) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } var buf bytes.Buffer _, err = buf.ReadFrom(zr) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } return buf.Bytes(), nil @@ -127,7 +127,7 @@ func decodeSpecCached() func() ([]byte, error) { // Constructs a synthetic filesystem for resolving external references when loading openapi specifications. func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - var res = make(map[string]func() ([]byte, error)) + res := make(map[string]func() ([]byte, error)) if len(pathToFile) > 0 { res[pathToFile] = rawSpec } @@ -141,12 +141,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { // Externally referenced files must be embedded in the corresponding golang packages. // Urls can be supported but this task was out of the scope. func GetSwagger() (swagger *openapi3.T, err error) { - var resolvePath = PathToRawSpec("") + resolvePath := PathToRawSpec("") loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - var pathToFile = url.String() + pathToFile := url.String() pathToFile = path.Clean(pathToFile) getSpec, ok := resolvePath[pathToFile] if !ok { diff --git a/daemon/mgmtapi/BUILD.bazel b/daemon/mgmtapi/BUILD.bazel index 7d20b0599c..5a5414ddb4 100644 --- a/daemon/mgmtapi/BUILD.bazel +++ b/daemon/mgmtapi/BUILD.bazel @@ -32,8 +32,8 @@ go_library( "//private/mgmtapi:go_default_library", "//private/mgmtapi/cppki/api:go_default_library", "//private/mgmtapi/segments/api:go_default_library", - "@com_github_deepmap_oapi_codegen//pkg/runtime:go_default_library", # keep "@com_github_getkin_kin_openapi//openapi3:go_default_library", # keep "@com_github_go_chi_chi_v5//:go_default_library", # keep + "@com_github_oapi_codegen_runtime//:go_default_library", # keep ], ) diff --git a/daemon/mgmtapi/client.gen.go b/daemon/mgmtapi/client.gen.go index b6d34cf5ec..8979f51107 100644 --- a/daemon/mgmtapi/client.gen.go +++ b/daemon/mgmtapi/client.gen.go @@ -13,7 +13,7 @@ import ( "net/url" "strings" - "github.com/deepmap/oapi-codegen/pkg/runtime" + "github.com/oapi-codegen/runtime" ) // RequestEditorFn is the function signature for the RequestEditor callback function @@ -107,7 +107,7 @@ type ClientInterface interface { // GetLogLevel request GetLogLevel(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // SetLogLevel request with any body + // SetLogLevelWithBody request with any body SetLogLevelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) SetLogLevel(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -318,58 +318,60 @@ func NewGetCertificatesRequest(server string, params *GetCertificatesParams) (*h return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.IsdAs != nil { + if params.IsdAs != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "isd_as", runtime.ParamLocationQuery, *params.IsdAs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "isd_as", runtime.ParamLocationQuery, *params.IsdAs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - if params.ValidAt != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "valid_at", runtime.ParamLocationQuery, *params.ValidAt); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.ValidAt != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "valid_at", runtime.ParamLocationQuery, *params.ValidAt); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - } - - if params.All != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.All != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -586,42 +588,44 @@ func NewGetSegmentsRequest(server string, params *GetSegmentsParams) (*http.Requ return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.StartIsdAs != nil { + if params.StartIsdAs != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_isd_as", runtime.ParamLocationQuery, *params.StartIsdAs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_isd_as", runtime.ParamLocationQuery, *params.StartIsdAs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - if params.EndIsdAs != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_isd_as", runtime.ParamLocationQuery, *params.EndIsdAs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.EndIsdAs != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_isd_as", runtime.ParamLocationQuery, *params.EndIsdAs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -717,42 +721,44 @@ func NewGetTrcsRequest(server string, params *GetTrcsParams) (*http.Request, err return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.Isd != nil { + if params.Isd != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", false, "isd", runtime.ParamLocationQuery, *params.Isd); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", false, "isd", runtime.ParamLocationQuery, *params.Isd); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - } - - if params.All != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.All != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -900,53 +906,53 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetCertificates request + // GetCertificatesWithResponse request GetCertificatesWithResponse(ctx context.Context, params *GetCertificatesParams, reqEditors ...RequestEditorFn) (*GetCertificatesResponse, error) - // GetCertificate request + // GetCertificateWithResponse request GetCertificateWithResponse(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*GetCertificateResponse, error) - // GetCertificateBlob request + // GetCertificateBlobWithResponse request GetCertificateBlobWithResponse(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*GetCertificateBlobResponse, error) - // GetConfig request + // GetConfigWithResponse request GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error) - // GetInfo request + // GetInfoWithResponse request GetInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInfoResponse, error) - // GetLogLevel request + // GetLogLevelWithResponse request GetLogLevelWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLogLevelResponse, error) - // SetLogLevel request with any body + // SetLogLevelWithBodyWithResponse request with any body SetLogLevelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error) SetLogLevelWithResponse(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error) - // GetSegments request + // GetSegmentsWithResponse request GetSegmentsWithResponse(ctx context.Context, params *GetSegmentsParams, reqEditors ...RequestEditorFn) (*GetSegmentsResponse, error) - // GetSegment request + // GetSegmentWithResponse request GetSegmentWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetSegmentResponse, error) - // GetSegmentBlob request + // GetSegmentBlobWithResponse request GetSegmentBlobWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetSegmentBlobResponse, error) - // GetTrcs request + // GetTrcsWithResponse request GetTrcsWithResponse(ctx context.Context, params *GetTrcsParams, reqEditors ...RequestEditorFn) (*GetTrcsResponse, error) - // GetTrc request + // GetTrcWithResponse request GetTrcWithResponse(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*GetTrcResponse, error) - // GetTrcBlob request + // GetTrcBlobWithResponse request GetTrcBlobWithResponse(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*GetTrcBlobResponse, error) } type GetCertificatesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]ChainBrief - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *[]ChainBrief + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -966,10 +972,10 @@ func (r GetCertificatesResponse) StatusCode() int { } type GetCertificateResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Chain - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *Chain + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -989,9 +995,9 @@ func (r GetCertificateResponse) StatusCode() int { } type GetCertificateBlobResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -1013,7 +1019,7 @@ func (r GetCertificateBlobResponse) StatusCode() int { type GetConfigResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1035,7 +1041,7 @@ func (r GetConfigResponse) StatusCode() int { type GetInfoResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1058,7 +1064,7 @@ type GetLogLevelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LogLevel - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1081,7 +1087,7 @@ type SetLogLevelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LogLevel - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1101,10 +1107,10 @@ func (r SetLogLevelResponse) StatusCode() int { } type GetSegmentsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]SegmentBrief - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *[]SegmentBrief + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -1124,10 +1130,10 @@ func (r GetSegmentsResponse) StatusCode() int { } type GetSegmentResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Segment - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *Segment + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -1147,9 +1153,9 @@ func (r GetSegmentResponse) StatusCode() int { } type GetSegmentBlobResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -1172,7 +1178,7 @@ type GetTrcsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *[]TRCBrief - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1195,7 +1201,7 @@ type GetTrcResponse struct { Body []byte HTTPResponse *http.Response JSON200 *TRC - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1217,7 +1223,7 @@ func (r GetTrcResponse) StatusCode() int { type GetTrcBlobResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -1387,7 +1393,7 @@ func ParseGetCertificatesResponse(rsp *http.Response) (*GetCertificatesResponse, if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -1420,7 +1426,7 @@ func ParseGetCertificateResponse(rsp *http.Response) (*GetCertificateResponse, e if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -1446,7 +1452,7 @@ func ParseGetCertificateBlobResponse(rsp *http.Response) (*GetCertificateBlobRes if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -1468,7 +1474,7 @@ func ParseGetConfigResponse(rsp *http.Response) (*GetConfigResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -1494,7 +1500,7 @@ func ParseGetInfoResponse(rsp *http.Response) (*GetInfoResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -1527,7 +1533,7 @@ func ParseGetLogLevelResponse(rsp *http.Response) (*GetLogLevelResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -1560,7 +1566,7 @@ func ParseSetLogLevelResponse(rsp *http.Response) (*SetLogLevelResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -1597,7 +1603,7 @@ func ParseGetSegmentsResponse(rsp *http.Response) (*GetSegmentsResponse, error) if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -1630,7 +1636,7 @@ func ParseGetSegmentResponse(rsp *http.Response) (*GetSegmentResponse, error) { if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -1656,7 +1662,7 @@ func ParseGetSegmentBlobResponse(rsp *http.Response) (*GetSegmentBlobResponse, e if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -1685,7 +1691,7 @@ func ParseGetTrcsResponse(rsp *http.Response) (*GetTrcsResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -1718,7 +1724,7 @@ func ParseGetTrcResponse(rsp *http.Response) (*GetTrcResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -1744,7 +1750,7 @@ func ParseGetTrcBlobResponse(rsp *http.Response) (*GetTrcBlobResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/daemon/mgmtapi/server.gen.go b/daemon/mgmtapi/server.gen.go index d7562b91be..d340dcdc7a 100644 --- a/daemon/mgmtapi/server.gen.go +++ b/daemon/mgmtapi/server.gen.go @@ -7,8 +7,8 @@ import ( "fmt" "net/http" - "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/go-chi/chi/v5" + "github.com/oapi-codegen/runtime" ) // ServerInterface represents all server handlers. @@ -54,6 +54,88 @@ type ServerInterface interface { GetTrcBlob(w http.ResponseWriter, r *http.Request, isd int, base int, serial int) } +// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. + +type Unimplemented struct{} + +// List the certificate chains +// (GET /certificates) +func (_ Unimplemented) GetCertificates(w http.ResponseWriter, r *http.Request, params GetCertificatesParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the certificate chain +// (GET /certificates/{chain-id}) +func (_ Unimplemented) GetCertificate(w http.ResponseWriter, r *http.Request, chainId ChainID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the certificate chain blob +// (GET /certificates/{chain-id}/blob) +func (_ Unimplemented) GetCertificateBlob(w http.ResponseWriter, r *http.Request, chainId ChainID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Prints the TOML configuration file. +// (GET /config) +func (_ Unimplemented) GetConfig(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Basic information page about the control service process. +// (GET /info) +func (_ Unimplemented) GetInfo(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get logging level +// (GET /log/level) +func (_ Unimplemented) GetLogLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set logging level +// (PUT /log/level) +func (_ Unimplemented) SetLogLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// List the SCION path segments +// (GET /segments) +func (_ Unimplemented) GetSegments(w http.ResponseWriter, r *http.Request, params GetSegmentsParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the SCION path segment description +// (GET /segments/{segment-id}) +func (_ Unimplemented) GetSegment(w http.ResponseWriter, r *http.Request, segmentId SegmentID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the SCION path segment blob +// (GET /segments/{segment-id}/blob) +func (_ Unimplemented) GetSegmentBlob(w http.ResponseWriter, r *http.Request, segmentId SegmentID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// List the TRCs +// (GET /trcs) +func (_ Unimplemented) GetTrcs(w http.ResponseWriter, r *http.Request, params GetTrcsParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the TRC +// (GET /trcs/isd{isd}-b{base}-s{serial}) +func (_ Unimplemented) GetTrc(w http.ResponseWriter, r *http.Request, isd int, base int, serial int) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the TRC blob +// (GET /trcs/isd{isd}-b{base}-s{serial}/blob) +func (_ Unimplemented) GetTrcBlob(w http.ResponseWriter, r *http.Request, isd int, base int, serial int) { + w.WriteHeader(http.StatusNotImplemented) +} + // ServerInterfaceWrapper converts contexts to parameters. type ServerInterfaceWrapper struct { Handler ServerInterface @@ -96,9 +178,9 @@ func (siw *ServerInterfaceWrapper) GetCertificates(w http.ResponseWriter, r *htt return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetCertificates(w, r, params) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -122,9 +204,9 @@ func (siw *ServerInterfaceWrapper) GetCertificate(w http.ResponseWriter, r *http return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetCertificate(w, r, chainId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -148,9 +230,9 @@ func (siw *ServerInterfaceWrapper) GetCertificateBlob(w http.ResponseWriter, r * return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetCertificateBlob(w, r, chainId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -163,9 +245,9 @@ func (siw *ServerInterfaceWrapper) GetCertificateBlob(w http.ResponseWriter, r * func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetConfig(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -178,9 +260,9 @@ func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Requ func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetInfo(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -193,9 +275,9 @@ func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Reques func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetLogLevel(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -208,9 +290,9 @@ func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Re func (siw *ServerInterfaceWrapper) SetLogLevel(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.SetLogLevel(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -244,9 +326,9 @@ func (siw *ServerInterfaceWrapper) GetSegments(w http.ResponseWriter, r *http.Re return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSegments(w, r, params) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -270,9 +352,9 @@ func (siw *ServerInterfaceWrapper) GetSegment(w http.ResponseWriter, r *http.Req return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSegment(w, r, segmentId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -296,9 +378,9 @@ func (siw *ServerInterfaceWrapper) GetSegmentBlob(w http.ResponseWriter, r *http return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSegmentBlob(w, r, segmentId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -332,9 +414,9 @@ func (siw *ServerInterfaceWrapper) GetTrcs(w http.ResponseWriter, r *http.Reques return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetTrcs(w, r, params) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -376,9 +458,9 @@ func (siw *ServerInterfaceWrapper) GetTrc(w http.ResponseWriter, r *http.Request return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetTrc(w, r, isd, base, serial) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -420,9 +502,9 @@ func (siw *ServerInterfaceWrapper) GetTrcBlob(w http.ResponseWriter, r *http.Req return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetTrcBlob(w, r, isd, base, serial) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -444,16 +526,16 @@ func (e *UnescapedCookieParamError) Unwrap() error { return e.Err } -type UnmarshallingParamError struct { +type UnmarshalingParamError struct { ParamName string Err error } -func (e *UnmarshallingParamError) Error() string { - return fmt.Sprintf("Error unmarshalling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) } -func (e *UnmarshallingParamError) Unwrap() error { +func (e *UnmarshalingParamError) Unwrap() error { return e.Err } diff --git a/daemon/mgmtapi/spec.gen.go b/daemon/mgmtapi/spec.gen.go index b7982b4e38..743bd4dd32 100644 --- a/daemon/mgmtapi/spec.gen.go +++ b/daemon/mgmtapi/spec.gen.go @@ -75,16 +75,16 @@ var swaggerSpec = []string{ func decodeSpec() ([]byte, error) { zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %s", err) + return nil, fmt.Errorf("error base64 decoding spec: %w", err) } zr, err := gzip.NewReader(bytes.NewReader(zipped)) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } var buf bytes.Buffer _, err = buf.ReadFrom(zr) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } return buf.Bytes(), nil @@ -102,7 +102,7 @@ func decodeSpecCached() func() ([]byte, error) { // Constructs a synthetic filesystem for resolving external references when loading openapi specifications. func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - var res = make(map[string]func() ([]byte, error)) + res := make(map[string]func() ([]byte, error)) if len(pathToFile) > 0 { res[pathToFile] = rawSpec } @@ -116,12 +116,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { // Externally referenced files must be embedded in the corresponding golang packages. // Urls can be supported but this task was out of the scope. func GetSwagger() (swagger *openapi3.T, err error) { - var resolvePath = PathToRawSpec("") + resolvePath := PathToRawSpec("") loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - var pathToFile = url.String() + pathToFile := url.String() pathToFile = path.Clean(pathToFile) getSpec, ok := resolvePath[pathToFile] if !ok { diff --git a/dispatcher/mgmtapi/client.gen.go b/dispatcher/mgmtapi/client.gen.go index d87b18ca40..d61cd66f1f 100644 --- a/dispatcher/mgmtapi/client.gen.go +++ b/dispatcher/mgmtapi/client.gen.go @@ -96,7 +96,7 @@ type ClientInterface interface { // GetLogLevel request GetLogLevel(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // SetLogLevel request with any body + // SetLogLevelWithBody request with any body SetLogLevelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) SetLogLevel(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -326,16 +326,16 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetConfig request + // GetConfigWithResponse request GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error) - // GetInfo request + // GetInfoWithResponse request GetInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInfoResponse, error) - // GetLogLevel request + // GetLogLevelWithResponse request GetLogLevelWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLogLevelResponse, error) - // SetLogLevel request with any body + // SetLogLevelWithBodyWithResponse request with any body SetLogLevelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error) SetLogLevelWithResponse(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error) @@ -344,7 +344,7 @@ type ClientWithResponsesInterface interface { type GetConfigResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -366,7 +366,7 @@ func (r GetConfigResponse) StatusCode() int { type GetInfoResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -389,7 +389,7 @@ type GetLogLevelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LogLevel - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -412,7 +412,7 @@ type SetLogLevelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LogLevel - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -490,7 +490,7 @@ func ParseGetConfigResponse(rsp *http.Response) (*GetConfigResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -516,7 +516,7 @@ func ParseGetInfoResponse(rsp *http.Response) (*GetInfoResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -549,7 +549,7 @@ func ParseGetLogLevelResponse(rsp *http.Response) (*GetLogLevelResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -582,7 +582,7 @@ func ParseSetLogLevelResponse(rsp *http.Response) (*SetLogLevelResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/dispatcher/mgmtapi/server.gen.go b/dispatcher/mgmtapi/server.gen.go index c6b1ffa8c4..4799ade917 100644 --- a/dispatcher/mgmtapi/server.gen.go +++ b/dispatcher/mgmtapi/server.gen.go @@ -26,6 +26,34 @@ type ServerInterface interface { SetLogLevel(w http.ResponseWriter, r *http.Request) } +// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. + +type Unimplemented struct{} + +// Prints the TOML configuration file. +// (GET /config) +func (_ Unimplemented) GetConfig(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Basic information page about the control service process. +// (GET /info) +func (_ Unimplemented) GetInfo(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get logging level +// (GET /log/level) +func (_ Unimplemented) GetLogLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set logging level +// (PUT /log/level) +func (_ Unimplemented) SetLogLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // ServerInterfaceWrapper converts contexts to parameters. type ServerInterfaceWrapper struct { Handler ServerInterface @@ -39,9 +67,9 @@ type MiddlewareFunc func(http.Handler) http.Handler func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetConfig(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -54,9 +82,9 @@ func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Requ func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetInfo(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -69,9 +97,9 @@ func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Reques func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetLogLevel(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -84,9 +112,9 @@ func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Re func (siw *ServerInterfaceWrapper) SetLogLevel(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.SetLogLevel(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -108,16 +136,16 @@ func (e *UnescapedCookieParamError) Unwrap() error { return e.Err } -type UnmarshallingParamError struct { +type UnmarshalingParamError struct { ParamName string Err error } -func (e *UnmarshallingParamError) Error() string { - return fmt.Sprintf("Error unmarshalling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) } -func (e *UnmarshallingParamError) Unwrap() error { +func (e *UnmarshalingParamError) Unwrap() error { return e.Err } diff --git a/dispatcher/mgmtapi/spec.gen.go b/dispatcher/mgmtapi/spec.gen.go index 1beab4eb20..26d83dc666 100644 --- a/dispatcher/mgmtapi/spec.gen.go +++ b/dispatcher/mgmtapi/spec.gen.go @@ -36,16 +36,16 @@ var swaggerSpec = []string{ func decodeSpec() ([]byte, error) { zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %s", err) + return nil, fmt.Errorf("error base64 decoding spec: %w", err) } zr, err := gzip.NewReader(bytes.NewReader(zipped)) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } var buf bytes.Buffer _, err = buf.ReadFrom(zr) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } return buf.Bytes(), nil @@ -63,7 +63,7 @@ func decodeSpecCached() func() ([]byte, error) { // Constructs a synthetic filesystem for resolving external references when loading openapi specifications. func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - var res = make(map[string]func() ([]byte, error)) + res := make(map[string]func() ([]byte, error)) if len(pathToFile) > 0 { res[pathToFile] = rawSpec } @@ -77,12 +77,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { // Externally referenced files must be embedded in the corresponding golang packages. // Urls can be supported but this task was out of the scope. func GetSwagger() (swagger *openapi3.T, err error) { - var resolvePath = PathToRawSpec("") + resolvePath := PathToRawSpec("") loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - var pathToFile = url.String() + pathToFile := url.String() pathToFile = path.Clean(pathToFile) getSpec, ok := resolvePath[pathToFile] if !ok { diff --git a/gateway/mgmtapi/BUILD.bazel b/gateway/mgmtapi/BUILD.bazel index ecf7d7a5c8..1aad622f33 100644 --- a/gateway/mgmtapi/BUILD.bazel +++ b/gateway/mgmtapi/BUILD.bazel @@ -30,8 +30,8 @@ go_library( visibility = ["//visibility:public"], deps = [ "//private/mgmtapi:go_default_library", - "@com_github_deepmap_oapi_codegen//pkg/runtime:go_default_library", # keep "@com_github_getkin_kin_openapi//openapi3:go_default_library", # keep "@com_github_go_chi_chi_v5//:go_default_library", # keep + "@com_github_oapi_codegen_runtime//:go_default_library", # keep ], ) diff --git a/gateway/mgmtapi/client.gen.go b/gateway/mgmtapi/client.gen.go index d87b18ca40..d61cd66f1f 100644 --- a/gateway/mgmtapi/client.gen.go +++ b/gateway/mgmtapi/client.gen.go @@ -96,7 +96,7 @@ type ClientInterface interface { // GetLogLevel request GetLogLevel(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // SetLogLevel request with any body + // SetLogLevelWithBody request with any body SetLogLevelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) SetLogLevel(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -326,16 +326,16 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetConfig request + // GetConfigWithResponse request GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error) - // GetInfo request + // GetInfoWithResponse request GetInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInfoResponse, error) - // GetLogLevel request + // GetLogLevelWithResponse request GetLogLevelWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLogLevelResponse, error) - // SetLogLevel request with any body + // SetLogLevelWithBodyWithResponse request with any body SetLogLevelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error) SetLogLevelWithResponse(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error) @@ -344,7 +344,7 @@ type ClientWithResponsesInterface interface { type GetConfigResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -366,7 +366,7 @@ func (r GetConfigResponse) StatusCode() int { type GetInfoResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -389,7 +389,7 @@ type GetLogLevelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LogLevel - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -412,7 +412,7 @@ type SetLogLevelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LogLevel - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -490,7 +490,7 @@ func ParseGetConfigResponse(rsp *http.Response) (*GetConfigResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -516,7 +516,7 @@ func ParseGetInfoResponse(rsp *http.Response) (*GetInfoResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -549,7 +549,7 @@ func ParseGetLogLevelResponse(rsp *http.Response) (*GetLogLevelResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -582,7 +582,7 @@ func ParseSetLogLevelResponse(rsp *http.Response) (*SetLogLevelResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/gateway/mgmtapi/server.gen.go b/gateway/mgmtapi/server.gen.go index c6b1ffa8c4..4799ade917 100644 --- a/gateway/mgmtapi/server.gen.go +++ b/gateway/mgmtapi/server.gen.go @@ -26,6 +26,34 @@ type ServerInterface interface { SetLogLevel(w http.ResponseWriter, r *http.Request) } +// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. + +type Unimplemented struct{} + +// Prints the TOML configuration file. +// (GET /config) +func (_ Unimplemented) GetConfig(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Basic information page about the control service process. +// (GET /info) +func (_ Unimplemented) GetInfo(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get logging level +// (GET /log/level) +func (_ Unimplemented) GetLogLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set logging level +// (PUT /log/level) +func (_ Unimplemented) SetLogLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // ServerInterfaceWrapper converts contexts to parameters. type ServerInterfaceWrapper struct { Handler ServerInterface @@ -39,9 +67,9 @@ type MiddlewareFunc func(http.Handler) http.Handler func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetConfig(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -54,9 +82,9 @@ func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Requ func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetInfo(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -69,9 +97,9 @@ func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Reques func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetLogLevel(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -84,9 +112,9 @@ func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Re func (siw *ServerInterfaceWrapper) SetLogLevel(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.SetLogLevel(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -108,16 +136,16 @@ func (e *UnescapedCookieParamError) Unwrap() error { return e.Err } -type UnmarshallingParamError struct { +type UnmarshalingParamError struct { ParamName string Err error } -func (e *UnmarshallingParamError) Error() string { - return fmt.Sprintf("Error unmarshalling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) } -func (e *UnmarshallingParamError) Unwrap() error { +func (e *UnmarshalingParamError) Unwrap() error { return e.Err } diff --git a/gateway/mgmtapi/spec.gen.go b/gateway/mgmtapi/spec.gen.go index ca1dde80c9..74a79c8a77 100644 --- a/gateway/mgmtapi/spec.gen.go +++ b/gateway/mgmtapi/spec.gen.go @@ -36,16 +36,16 @@ var swaggerSpec = []string{ func decodeSpec() ([]byte, error) { zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %s", err) + return nil, fmt.Errorf("error base64 decoding spec: %w", err) } zr, err := gzip.NewReader(bytes.NewReader(zipped)) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } var buf bytes.Buffer _, err = buf.ReadFrom(zr) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } return buf.Bytes(), nil @@ -63,7 +63,7 @@ func decodeSpecCached() func() ([]byte, error) { // Constructs a synthetic filesystem for resolving external references when loading openapi specifications. func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - var res = make(map[string]func() ([]byte, error)) + res := make(map[string]func() ([]byte, error)) if len(pathToFile) > 0 { res[pathToFile] = rawSpec } @@ -77,12 +77,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { // Externally referenced files must be embedded in the corresponding golang packages. // Urls can be supported but this task was out of the scope. func GetSwagger() (swagger *openapi3.T, err error) { - var resolvePath = PathToRawSpec("") + resolvePath := PathToRawSpec("") loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - var pathToFile = url.String() + pathToFile := url.String() pathToFile = path.Clean(pathToFile) getSpec, ok := resolvePath[pathToFile] if !ok { diff --git a/go.mod b/go.mod index 67f8b840f5..77f168f212 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ require ( github.com/bazelbuild/rules_go v0.38.1 github.com/buildkite/go-buildkite/v2 v2.9.0 github.com/dchest/cmac v1.0.0 - github.com/deepmap/oapi-codegen v1.12.5-0.20230221180206-2b52cd58cf5b + github.com/deepmap/oapi-codegen/v2 v2.0.0 github.com/fatih/color v1.14.1 - github.com/getkin/kin-openapi v0.114.0 + github.com/getkin/kin-openapi v0.118.0 github.com/go-chi/chi/v5 v5.0.8 github.com/go-chi/cors v1.2.1 github.com/golang/mock v1.6.0 @@ -21,8 +21,9 @@ require ( github.com/hashicorp/golang-lru v0.6.0 github.com/iancoleman/strcase v0.2.0 github.com/lestrrat-go/jwx v1.2.25 - github.com/mattn/go-isatty v0.0.17 + github.com/mattn/go-isatty v0.0.19 github.com/mattn/go-sqlite3 v1.14.17 + github.com/oapi-codegen/runtime v1.0.0 github.com/olekukonko/tablewriter v0.0.5 github.com/opentracing/opentracing-go v1.2.0 github.com/patrickmn/go-cache v2.1.1-0.20180815053127-5633e0862627+incompatible @@ -37,16 +38,16 @@ require ( github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.15.0 - github.com/stretchr/testify v1.8.1 + github.com/stretchr/testify v1.8.4 github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/vishvananda/netlink v1.2.1-beta.2 go.uber.org/goleak v1.2.1 go.uber.org/zap v1.24.0 go4.org/netipx v0.0.0-20230125063823-8449b0a6169f - golang.org/x/crypto v0.6.0 - golang.org/x/net v0.10.0 + golang.org/x/crypto v0.12.0 + golang.org/x/net v0.14.0 golang.org/x/sync v0.3.0 - golang.org/x/tools v0.9.1 + golang.org/x/tools v0.12.0 google.golang.org/grpc v1.57.2 google.golang.org/grpc/examples v0.0.0-20230222033013-5353eaa44095 google.golang.org/protobuf v1.31.0 @@ -69,10 +70,10 @@ require ( github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/swag v0.21.1 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect - github.com/goccy/go-json v0.9.11 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/google/go-querystring v1.0.1-0.20190318165438-c8c88dbee036 // indirect github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect @@ -93,7 +94,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/onsi/ginkgo/v2 v2.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/pelletier/go-toml/v2 v2.0.9 // indirect github.com/perimeterx/marshmallow v1.1.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -112,9 +113,9 @@ require ( go.uber.org/mock v0.3.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect - golang.org/x/mod v0.11.0 // indirect + golang.org/x/mod v0.12.0 // indirect golang.org/x/sys v0.12.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/text v0.13.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 8efbd38662..c53bec95f1 100644 --- a/go.sum +++ b/go.sum @@ -89,8 +89,8 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go.mod h1:tmAIfUFEirG/Y8jhZ9M+h36obRZAk/1fcSpXwAVlfqE= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/deepmap/oapi-codegen v1.12.5-0.20230221180206-2b52cd58cf5b h1:LDDxTtOtlGKTubzsuonFRmhMgP5zfWmM+G3Ql948TAs= -github.com/deepmap/oapi-codegen v1.12.5-0.20230221180206-2b52cd58cf5b/go.mod h1:Oq/fBIJxL5rD6wZen0I3a6yXCwh7Fl0i8d5e4kYYA8c= +github.com/deepmap/oapi-codegen/v2 v2.0.0 h1:3TS7w3r+XnjKFXcbFbc16pTWzfTy0OLPkCsutEHjWDA= +github.com/deepmap/oapi-codegen/v2 v2.0.0/go.mod h1:7zR+ZL3WzLeCkr2k8oWTxEa0v8y/F25ane0l6A5UjLA= github.com/docker/cli v20.10.20+incompatible h1:lWQbHSHUFs7KraSN2jOJK7zbMS2jNCHI4mt4xUFUVQ4= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/docker v20.10.20+incompatible h1:kH9tx6XO+359d+iAkumyKDc5Q1kOwPuAUaeri48nD6E= @@ -108,8 +108,8 @@ github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8Wlg github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/getkin/kin-openapi v0.114.0 h1:ar7QiJpDdlR+zSyPjrLf8mNnpoFP/lI90XcywMCFNe8= -github.com/getkin/kin-openapi v0.114.0/go.mod h1:l5e9PaFUo9fyLJCPGQeXI2ML8c3P8BHOEV2VaAVf/pc= +github.com/getkin/kin-openapi v0.118.0 h1:z43njxPmJ7TaPpMSCQb7PN0dEYno4tyBPQcrFdHoLuM= +github.com/getkin/kin-openapi v0.118.0/go.mod h1:l5e9PaFUo9fyLJCPGQeXI2ML8c3P8BHOEV2VaAVf/pc= github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= @@ -137,8 +137,8 @@ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4 github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= -github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -211,8 +211,8 @@ github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbu github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= @@ -257,7 +257,7 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -290,8 +290,8 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= @@ -311,6 +311,8 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwd github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oapi-codegen/runtime v1.0.0 h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo= +github.com/oapi-codegen/runtime v1.0.0/go.mod h1:LmCUMQuPB4M/nLXilQXhHw+BLZdDb18B34OO356yJ/A= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q= @@ -325,8 +327,8 @@ github.com/patrickmn/go-cache v2.1.1-0.20180815053127-5633e0862627+incompatible github.com/patrickmn/go-cache v2.1.1-0.20180815053127-5633e0862627+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= +github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/perimeterx/marshmallow v1.1.4 h1:pZLDH9RjlLGGorbXhcaQLhfuV0pFMNfPO55FuFkxqLw= github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -411,8 +413,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= @@ -421,8 +424,8 @@ github.com/uber/jaeger-lib v2.0.0+incompatible h1:iMSCV0rmXEogjNWPh2D0xk9YVKvrtG github.com/uber/jaeger-lib v2.0.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/vbatts/tar-split v0.11.2 h1:Via6XqJr0hceW4wff3QRzD5gAk/tatMw/4ZA7cTlIME= github.com/vishvananda/netlink v1.2.1-beta.2 h1:Llsql0lnQEbHj0I1OuKyp8otXp0r3q0mPkuhwHfStVs= github.com/vishvananda/netlink v1.2.1-beta.2/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= @@ -464,8 +467,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -491,6 +494,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -502,8 +506,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -542,8 +546,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -619,6 +623,7 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -631,8 +636,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -687,8 +692,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= -golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go_deps.bzl b/go_deps.bzl index f1030d3e38..20859e8d18 100644 --- a/go_deps.bzl +++ b/go_deps.bzl @@ -25,6 +25,12 @@ def go_deps(): sum = "h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=", version = "v0.0.0-20190924025748-f65c72e2690d", ) + go_repository( + name = "com_github_andybalholm_brotli", + importpath = "github.com/andybalholm/brotli", + sum = "h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=", + version = "v1.0.5", + ) go_repository( name = "com_github_antlr_antlr4_runtime_go_antlr", importpath = "github.com/antlr/antlr4/runtime/Go/antlr", @@ -43,6 +49,12 @@ def go_deps(): sum = "h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q=", version = "v0.4.0", ) + go_repository( + name = "com_github_aymerick_douceur", + importpath = "github.com/aymerick/douceur", + sum = "h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=", + version = "v0.2.0", + ) go_repository( name = "com_github_azure_go_ansiterm", importpath = "github.com/Azure/go-ansiterm", @@ -82,8 +94,8 @@ def go_deps(): go_repository( name = "com_github_burntsushi_toml", importpath = "github.com/BurntSushi/toml", - sum = "h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=", - version = "v0.4.1", + sum = "h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=", + version = "v1.3.2", ) go_repository( name = "com_github_burntsushi_xgb", @@ -91,6 +103,12 @@ def go_deps(): sum = "h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=", version = "v0.0.0-20160522181843-27f122750802", ) + go_repository( + name = "com_github_bytedance_sonic", + importpath = "github.com/bytedance/sonic", + sum = "h1:uNSnscRapXTwUgTyOF0GVljYD08p9X/Lbr9MweSV3V0=", + version = "v1.10.0-rc3", + ) go_repository( name = "com_github_cenkalti_backoff", importpath = "github.com/cenkalti/backoff", @@ -109,6 +127,18 @@ def go_deps(): sum = "h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=", version = "v2.2.0", ) + go_repository( + name = "com_github_chenzhuoyu_base64x", + importpath = "github.com/chenzhuoyu/base64x", + sum = "h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=", + version = "v0.0.0-20230717121745-296ad89f973d", + ) + go_repository( + name = "com_github_chenzhuoyu_iasm", + importpath = "github.com/chenzhuoyu/iasm", + sum = "h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo=", + version = "v0.9.0", + ) go_repository( name = "com_github_chzyer_logex", importpath = "github.com/chzyer/logex", @@ -133,6 +163,18 @@ def go_deps(): sum = "h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=", version = "v0.3.4", ) + go_repository( + name = "com_github_cloudykit_fastprinter", + importpath = "github.com/CloudyKit/fastprinter", + sum = "h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c=", + version = "v0.0.0-20200109182630-33d98a066a53", + ) + go_repository( + name = "com_github_cloudykit_jet_v6", + importpath = "github.com/CloudyKit/jet/v6", + sum = "h1:EpcZ6SR9n28BUGtNJSvlBqf90IpjeFr36Tizxhn/oME=", + version = "v6.2.0", + ) go_repository( name = "com_github_cncf_udpa_go", importpath = "github.com/cncf/udpa/go", @@ -206,10 +248,10 @@ def go_deps(): version = "v4.0.1", ) go_repository( - name = "com_github_deepmap_oapi_codegen", - importpath = "github.com/deepmap/oapi-codegen", - sum = "h1:LDDxTtOtlGKTubzsuonFRmhMgP5zfWmM+G3Ql948TAs=", - version = "v1.12.5-0.20230221180206-2b52cd58cf5b", + name = "com_github_deepmap_oapi_codegen_v2", + importpath = "github.com/deepmap/oapi-codegen/v2", + sum = "h1:3TS7w3r+XnjKFXcbFbc16pTWzfTy0OLPkCsutEHjWDA=", + version = "v2.0.0", ) go_repository( name = "com_github_docker_cli", @@ -277,6 +319,18 @@ def go_deps(): sum = "h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=", version = "v1.14.1", ) + go_repository( + name = "com_github_fatih_structs", + importpath = "github.com/fatih/structs", + sum = "h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_flosch_pongo2_v4", + importpath = "github.com/flosch/pongo2/v4", + sum = "h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw=", + version = "v4.0.2", + ) go_repository( name = "com_github_francoispqt_gojay", importpath = "github.com/francoispqt/gojay", @@ -295,11 +349,17 @@ def go_deps(): sum = "h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=", version = "v1.6.0", ) + go_repository( + name = "com_github_gabriel_vasile_mimetype", + importpath = "github.com/gabriel-vasile/mimetype", + sum = "h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=", + version = "v1.4.2", + ) go_repository( name = "com_github_getkin_kin_openapi", importpath = "github.com/getkin/kin-openapi", - sum = "h1:ar7QiJpDdlR+zSyPjrLf8mNnpoFP/lI90XcywMCFNe8=", - version = "v0.114.0", + sum = "h1:z43njxPmJ7TaPpMSCQb7PN0dEYno4tyBPQcrFdHoLuM=", + version = "v0.118.0", ) go_repository( name = "com_github_gin_contrib_sse", @@ -310,8 +370,8 @@ def go_deps(): go_repository( name = "com_github_gin_gonic_gin", importpath = "github.com/gin-gonic/gin", - sum = "h1:UzKToD9/PoFj/V4rvlKqTRKnQYyz8Sc1MJlv4JHPtvY=", - version = "v1.8.2", + sum = "h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=", + version = "v1.9.1", ) go_repository( name = "com_github_go_chi_chi_v5", @@ -376,20 +436,20 @@ def go_deps(): go_repository( name = "com_github_go_playground_locales", importpath = "github.com/go-playground/locales", - sum = "h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=", - version = "v0.14.0", + sum = "h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=", + version = "v0.14.1", ) go_repository( name = "com_github_go_playground_universal_translator", importpath = "github.com/go-playground/universal-translator", - sum = "h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=", - version = "v0.18.0", + sum = "h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=", + version = "v0.18.1", ) go_repository( name = "com_github_go_playground_validator_v10", importpath = "github.com/go-playground/validator/v10", - sum = "h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ=", - version = "v10.11.1", + sum = "h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k=", + version = "v10.14.1", ) go_repository( name = "com_github_go_stack_stack", @@ -412,8 +472,8 @@ def go_deps(): go_repository( name = "com_github_goccy_go_json", importpath = "github.com/goccy/go-json", - sum = "h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk=", - version = "v0.9.11", + sum = "h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=", + version = "v0.10.2", ) go_repository( name = "com_github_gogo_protobuf", @@ -433,12 +493,6 @@ def go_deps(): sum = "h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=", version = "v0.0.0-20210331224755-41bb18bfe9da", ) - go_repository( - name = "com_github_golang_jwt_jwt", - importpath = "github.com/golang-jwt/jwt", - sum = "h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=", - version = "v3.2.2+incompatible", - ) go_repository( name = "com_github_golang_mock", importpath = "github.com/golang/mock", @@ -452,10 +506,16 @@ def go_deps(): version = "v1.5.3", ) go_repository( - name = "com_github_golangci_lint_1", - importpath = "github.com/golangci/lint-1", - sum = "h1:utua3L2IbQJmauC5IXdEA547bcoU5dozgQAfc8Onsg4=", - version = "v0.0.0-20181222135242-d2cdd8c08219", + name = "com_github_golang_snappy", + importpath = "github.com/golang/snappy", + sum = "h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=", + version = "v0.0.4", + ) + go_repository( + name = "com_github_gomarkdown_markdown", + importpath = "github.com/gomarkdown/markdown", + sum = "h1:uK3X/2mt4tbSGoHvbLBHUny7CKiuwUip3MArtukol4E=", + version = "v0.0.0-20230716120725-531d2d74bc12", ) go_repository( name = "com_github_google_btree", @@ -520,8 +580,8 @@ def go_deps(): go_repository( name = "com_github_google_uuid", importpath = "github.com/google/uuid", - sum = "h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=", - version = "v1.3.0", + sum = "h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=", + version = "v1.3.1", ) go_repository( name = "com_github_googleapis_enterprise_certificate_proxy", @@ -547,6 +607,12 @@ def go_deps(): sum = "h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=", version = "v0.0.0-20181017120253-0766667cb4d1", ) + go_repository( + name = "com_github_gorilla_css", + importpath = "github.com/gorilla/css", + sum = "h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=", + version = "v1.0.0", + ) go_repository( name = "com_github_gorilla_mux", importpath = "github.com/gorilla/mux", @@ -643,6 +709,18 @@ def go_deps(): sum = "h1:YW3WGUoJEXYfzWBjn00zIlrw7brGVD0fUKRYDPAPhrc=", version = "v0.1.0", ) + go_repository( + name = "com_github_iris_contrib_schema", + importpath = "github.com/iris-contrib/schema", + sum = "h1:CPSBLyx2e91H2yJzPuhGuifVRnZBBJ3pCOMbOvPZaTw=", + version = "v0.0.6", + ) + go_repository( + name = "com_github_joker_jade", + importpath = "github.com/Joker/jade", + sum = "h1:Qbeh12Vq6BxURXT1qZBRHsDxeURB8ztcL6f3EXSGeHk=", + version = "v1.1.3", + ) go_repository( name = "com_github_josharian_intern", importpath = "github.com/josharian/intern", @@ -685,6 +763,42 @@ def go_deps(): sum = "h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=", version = "v1.3.0", ) + go_repository( + name = "com_github_kataras_blocks", + importpath = "github.com/kataras/blocks", + sum = "h1:cF3RDY/vxnSRezc7vLFlQFTYXG/yAr1o7WImJuZbzC4=", + version = "v0.0.7", + ) + go_repository( + name = "com_github_kataras_golog", + importpath = "github.com/kataras/golog", + sum = "h1:vLvSDpP7kihFGKFAvBSofYo7qZNULYSHOH2D7rPTKJk=", + version = "v0.1.9", + ) + go_repository( + name = "com_github_kataras_iris_v12", + importpath = "github.com/kataras/iris/v12", + sum = "h1:R5UzUW4MIByBM6tKMG3UqJ7hL1JCEE+dkqQ8L72f6PU=", + version = "v12.2.5", + ) + go_repository( + name = "com_github_kataras_pio", + importpath = "github.com/kataras/pio", + sum = "h1:o52SfVYauS3J5X08fNjlGS5arXHjW/ItLkyLcKjoH6w=", + version = "v0.0.12", + ) + go_repository( + name = "com_github_kataras_sitemap", + importpath = "github.com/kataras/sitemap", + sum = "h1:w71CRMMKYMJh6LR2wTgnk5hSgjVNB9KL60n5e2KHvLY=", + version = "v0.0.6", + ) + go_repository( + name = "com_github_kataras_tunnel", + importpath = "github.com/kataras/tunnel", + sum = "h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA=", + version = "v0.0.4", + ) go_repository( name = "com_github_kballard_go_shellquote", importpath = "github.com/kballard/go-shellquote", @@ -706,14 +820,14 @@ def go_deps(): go_repository( name = "com_github_klauspost_compress", importpath = "github.com/klauspost/compress", - sum = "h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c=", - version = "v1.15.11", + sum = "h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=", + version = "v1.16.7", ) go_repository( name = "com_github_klauspost_cpuid_v2", importpath = "github.com/klauspost/cpuid/v2", - sum = "h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU=", - version = "v2.2.3", + sum = "h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=", + version = "v2.2.5", ) go_repository( name = "com_github_konsorten_go_windows_terminal_sequences", @@ -754,8 +868,8 @@ def go_deps(): go_repository( name = "com_github_labstack_echo_v4", importpath = "github.com/labstack/echo/v4", - sum = "h1:5CiyngihEO4HXsz3vVsJn7f8xAlWwRr3aY6Ih280ZKA=", - version = "v4.10.0", + sum = "h1:dEpLU2FLg4UVmvCGPuk/APjlH6GDpbEPti61srUUUs4=", + version = "v4.11.1", ) go_repository( name = "com_github_labstack_gommon", @@ -766,8 +880,8 @@ def go_deps(): go_repository( name = "com_github_leodido_go_urn", importpath = "github.com/leodido/go-urn", - sum = "h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=", - version = "v1.2.1", + sum = "h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=", + version = "v1.2.4", ) go_repository( name = "com_github_lestrrat_go_backoff_v2", @@ -811,18 +925,18 @@ def go_deps(): sum = "h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=", version = "v1.8.7", ) + go_repository( + name = "com_github_mailgun_raymond_v2", + importpath = "github.com/mailgun/raymond/v2", + sum = "h1:5dmlB680ZkFG2RN/0lvTAghrSxIESeu9/2aeDqACtjw=", + version = "v2.0.48", + ) go_repository( name = "com_github_mailru_easyjson", importpath = "github.com/mailru/easyjson", sum = "h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=", version = "v0.7.7", ) - go_repository( - name = "com_github_matryer_moq", - importpath = "github.com/matryer/moq", - sum = "h1:4j0goF/XK3pMTc7fJB3fveuTJoQNdavRX/78vlK3Xb4=", - version = "v0.3.0", - ) go_repository( name = "com_github_mattn_go_colorable", importpath = "github.com/mattn/go-colorable", @@ -832,8 +946,8 @@ def go_deps(): go_repository( name = "com_github_mattn_go_isatty", importpath = "github.com/mattn/go-isatty", - sum = "h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=", - version = "v0.0.17", + sum = "h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=", + version = "v0.0.19", ) go_repository( name = "com_github_mattn_go_runewidth", @@ -853,6 +967,12 @@ def go_deps(): sum = "h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=", version = "v1.0.1", ) + go_repository( + name = "com_github_microcosm_cc_bluemonday", + importpath = "github.com/microcosm-cc/bluemonday", + sum = "h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg=", + version = "v1.0.25", + ) go_repository( name = "com_github_microsoft_go_winio", importpath = "github.com/Microsoft/go-winio", @@ -913,6 +1033,12 @@ def go_deps(): sum = "h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=", version = "v0.0.0-20200227124842-a10e7caefd8e", ) + go_repository( + name = "com_github_oapi_codegen_runtime", + importpath = "github.com/oapi-codegen/runtime", + sum = "h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo=", + version = "v1.0.0", + ) go_repository( name = "com_github_olekukonko_tablewriter", importpath = "github.com/olekukonko/tablewriter", @@ -964,8 +1090,8 @@ def go_deps(): go_repository( name = "com_github_pelletier_go_toml_v2", importpath = "github.com/pelletier/go-toml/v2", - sum = "h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU=", - version = "v2.0.6", + sum = "h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=", + version = "v2.0.9", ) go_repository( name = "com_github_perimeterx_marshmallow", @@ -1063,12 +1189,24 @@ def go_deps(): sum = "h1:fipzMFW34hFUEc4D7fsLQFtE7yElkpgyS2zruedRdZk=", version = "v0.9.0", ) + go_repository( + name = "com_github_schollz_closestmatch", + importpath = "github.com/schollz/closestmatch", + sum = "h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk=", + version = "v2.1.0+incompatible", + ) go_repository( name = "com_github_sergi_go_diff", importpath = "github.com/sergi/go-diff", sum = "h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=", version = "v1.3.1", ) + go_repository( + name = "com_github_shopify_goreferrer", + importpath = "github.com/Shopify/goreferrer", + sum = "h1:KkH3I3sJuOLP3TjA/dfr4NAY8bghDwnXiU7cTKxQqo0=", + version = "v0.0.0-20220729165902-8cddb4f5de06", + ) go_repository( name = "com_github_sirupsen_logrus", importpath = "github.com/sirupsen/logrus", @@ -1144,8 +1282,8 @@ def go_deps(): go_repository( name = "com_github_stretchr_testify", importpath = "github.com/stretchr/testify", - sum = "h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=", - version = "v1.8.1", + sum = "h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=", + version = "v1.8.4", ) go_repository( name = "com_github_subosito_gotenv", @@ -1153,6 +1291,24 @@ def go_deps(): sum = "h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=", version = "v1.4.2", ) + go_repository( + name = "com_github_tdewolff_minify_v2", + importpath = "github.com/tdewolff/minify/v2", + sum = "h1:Q2BqOTmlMjoutkuD/OPCnJUpIqrzT3nRPkw+q+KpXS0=", + version = "v2.12.8", + ) + go_repository( + name = "com_github_tdewolff_parse_v2", + importpath = "github.com/tdewolff/parse/v2", + sum = "h1:WrFllrqmzAcrKHzoYgMupqgUBIfBVOb0yscFzDf8bBg=", + version = "v2.6.7", + ) + go_repository( + name = "com_github_twitchyliquid64_golang_asm", + importpath = "github.com/twitchyliquid64/golang-asm", + sum = "h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=", + version = "v0.15.1", + ) go_repository( name = "com_github_uber_jaeger_client_go", importpath = "github.com/uber/jaeger-client-go", @@ -1174,8 +1330,8 @@ def go_deps(): go_repository( name = "com_github_ugorji_go_codec", importpath = "github.com/ugorji/go/codec", - sum = "h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=", - version = "v1.2.7", + sum = "h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=", + version = "v1.2.11", ) go_repository( name = "com_github_valyala_bytebufferpool", @@ -1207,6 +1363,24 @@ def go_deps(): sum = "h1:4hwBBUfQCFe3Cym0ZtKyq7L16eZUtYKs+BaHDN6mAns=", version = "v0.0.0-20200728191858-db3c7e526aae", ) + go_repository( + name = "com_github_vmihailenco_msgpack_v5", + importpath = "github.com/vmihailenco/msgpack/v5", + sum = "h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU=", + version = "v5.3.5", + ) + go_repository( + name = "com_github_vmihailenco_tagparser_v2", + importpath = "github.com/vmihailenco/tagparser/v2", + sum = "h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_yosssi_ace", + importpath = "github.com/yosssi/ace", + sum = "h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA=", + version = "v0.0.5", + ) go_repository( name = "com_github_yuin_goldmark", importpath = "github.com/yuin/goldmark", @@ -1425,11 +1599,17 @@ def go_deps(): sum = "h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=", version = "v1.31.0", ) + go_repository( + name = "org_golang_x_arch", + importpath = "golang.org/x/arch", + sum = "h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc=", + version = "v0.4.0", + ) go_repository( name = "org_golang_x_crypto", importpath = "golang.org/x/crypto", - sum = "h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=", - version = "v0.6.0", + sum = "h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=", + version = "v0.12.0", ) go_repository( name = "org_golang_x_exp", @@ -1452,8 +1632,8 @@ def go_deps(): go_repository( name = "org_golang_x_lint", importpath = "golang.org/x/lint", - sum = "h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI=", - version = "v0.0.0-20201208152925-83fdc39ff7b5", + sum = "h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=", + version = "v0.0.0-20210508222113-6edffad5e616", ) go_repository( name = "org_golang_x_mobile", @@ -1464,14 +1644,14 @@ def go_deps(): go_repository( name = "org_golang_x_mod", importpath = "golang.org/x/mod", - sum = "h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=", - version = "v0.11.0", + sum = "h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=", + version = "v0.12.0", ) go_repository( name = "org_golang_x_net", importpath = "golang.org/x/net", - sum = "h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=", - version = "v0.10.0", + sum = "h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=", + version = "v0.14.0", ) go_repository( name = "org_golang_x_oauth2", @@ -1494,26 +1674,26 @@ def go_deps(): go_repository( name = "org_golang_x_term", importpath = "golang.org/x/term", - sum = "h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=", - version = "v0.8.0", + sum = "h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=", + version = "v0.11.0", ) go_repository( name = "org_golang_x_text", importpath = "golang.org/x/text", - sum = "h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=", - version = "v0.9.0", + sum = "h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=", + version = "v0.13.0", ) go_repository( name = "org_golang_x_time", importpath = "golang.org/x/time", - sum = "h1:52I/1L54xyEQAYdtcSuxtiT84KGYTBGXwayxmIpNJhE=", - version = "v0.2.0", + sum = "h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=", + version = "v0.3.0", ) go_repository( name = "org_golang_x_tools", importpath = "golang.org/x/tools", - sum = "h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=", - version = "v0.9.1", + sum = "h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=", + version = "v0.12.0", ) go_repository( name = "org_golang_x_xerrors", diff --git a/licenses/data/com_github_deepmap_oapi_codegen/LICENSE b/licenses/data/com_github_deepmap_oapi_codegen_v2/LICENSE similarity index 100% rename from licenses/data/com_github_deepmap_oapi_codegen/LICENSE rename to licenses/data/com_github_deepmap_oapi_codegen_v2/LICENSE diff --git a/licenses/data/com_github_labstack_echo_v4/LICENSE b/licenses/data/com_github_labstack_echo_v4/LICENSE deleted file mode 100644 index c46d0105f7..0000000000 --- a/licenses/data/com_github_labstack_echo_v4/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2021 LabStack - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/licenses/data/com_github_labstack_gommon/LICENSE b/licenses/data/com_github_labstack_gommon/LICENSE deleted file mode 100644 index fc718faf2a..0000000000 --- a/licenses/data/com_github_labstack_gommon/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 labstack - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/licenses/data/com_github_oapi_codegen_runtime/LICENSE b/licenses/data/com_github_oapi_codegen_runtime/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/licenses/data/com_github_oapi_codegen_runtime/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/licenses/data/com_github_valyala_bytebufferpool/LICENSE b/licenses/data/com_github_valyala_bytebufferpool/LICENSE deleted file mode 100644 index f7c935c201..0000000000 --- a/licenses/data/com_github_valyala_bytebufferpool/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Aliaksandr Valialkin, VertaMedia - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/licenses/data/com_github_valyala_fasttemplate/LICENSE b/licenses/data/com_github_valyala_fasttemplate/LICENSE deleted file mode 100644 index 7125a63c4c..0000000000 --- a/licenses/data/com_github_valyala_fasttemplate/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Aliaksandr Valialkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/nogo.json b/nogo.json index 924de87ac9..d3ada15681 100644 --- a/nogo.json +++ b/nogo.json @@ -2,7 +2,6 @@ "assign": { "exclude_files": { "gazelle/walk/walk.go": "", - "com_github_deepmap_oapi_codegen/pkg/codegen/": "", "/org_modernc_sqlite": "" } }, @@ -149,7 +148,7 @@ }, "maincheck": { "exclude_files": { - "/com_github_deepmap_oapi_codegen/": "", + "/com_github_deepmap_oapi_codegen_v2/": "", "/com_github_golang_mock/mockgen": "", "/org_golang_x_tools": "", "gazelle/language/go/gen_std_package_list": "", @@ -184,7 +183,6 @@ "com_github_matttproud_golang_protobuf_extensions": "", "com_github_getkin_kin_openapi": "", "com_github_buildkite_go_buildkite_v2/buildkite": "", - "com_github_deepmap_oapi_codegen/pkg/runtime": "", "com_github_uber_jaeger_client_go/thrift": "", "com_github_hashicorp_hcl": "", "com_github_stretchr_testify/assert": "", @@ -199,7 +197,6 @@ "com_github_uber_jaeger_client_go": "", "com_github_spf13_viper": "", "com_github_labstack_echo_v4": "", - "com_github_deepmap_oapi_codegen": "", "pkg/private/serrors/errors.go": "err shadowed", "pkg/slayers/path/scion/raw.go": "err shadowed", "pkg/scrypto/cppki/trc.go": "err shadowed", @@ -212,7 +209,7 @@ "org_golang_x_mod": "", "org_golang_x_crypto/ed25519/internal/edwards25519": "", "com_github_vishvananda_netlink/nl": "", - "com_github_deepmap_oapi_codegen/pkg/codegen": "", + "com_github_deepmap_oapi_codegen_v2/pkg/codegen": "", "com_github_quic_go_quic_go": "", "com_github_bazelbuild_buildtools": "", "/bazel_gazelle/": "" diff --git a/private/ca/api/BUILD.bazel b/private/ca/api/BUILD.bazel index 2d17595466..bd175b3d81 100644 --- a/private/ca/api/BUILD.bazel +++ b/private/ca/api/BUILD.bazel @@ -19,7 +19,7 @@ go_library( importpath = "github.com/scionproto/scion/private/ca/api", visibility = ["//visibility:public"], deps = [ - "@com_github_deepmap_oapi_codegen//pkg/runtime:go_default_library", # keep - "@com_github_deepmap_oapi_codegen//pkg/types:go_default_library", # keep + "@com_github_oapi_codegen_runtime//:go_default_library", # keep + "@com_github_oapi_codegen_runtime//types:go_default_library", # keep ], ) diff --git a/private/ca/api/client.gen.go b/private/ca/api/client.gen.go index e32c482e37..bf2faefae1 100644 --- a/private/ca/api/client.gen.go +++ b/private/ca/api/client.gen.go @@ -13,7 +13,7 @@ import ( "net/url" "strings" - "github.com/deepmap/oapi-codegen/pkg/runtime" + "github.com/oapi-codegen/runtime" ) // RequestEditorFn is the function signature for the RequestEditor callback function @@ -89,7 +89,7 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // PostAuthToken request with any body + // PostAuthTokenWithBody request with any body PostAuthTokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PostAuthToken(ctx context.Context, body PostAuthTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -97,7 +97,7 @@ type ClientInterface interface { // GetHealthcheck request GetHealthcheck(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostCertificateRenewal request with any body + // PostCertificateRenewalWithBody request with any body PostCertificateRenewalWithBody(ctx context.Context, isdNumber int, asNumber AS, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PostCertificateRenewal(ctx context.Context, isdNumber int, asNumber AS, body PostCertificateRenewalJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -327,28 +327,28 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // PostAuthToken request with any body + // PostAuthTokenWithBodyWithResponse request with any body PostAuthTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthTokenResponse, error) PostAuthTokenWithResponse(ctx context.Context, body PostAuthTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthTokenResponse, error) - // GetHealthcheck request + // GetHealthcheckWithResponse request GetHealthcheckWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthcheckResponse, error) - // PostCertificateRenewal request with any body + // PostCertificateRenewalWithBodyWithResponse request with any body PostCertificateRenewalWithBodyWithResponse(ctx context.Context, isdNumber int, asNumber AS, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostCertificateRenewalResponse, error) PostCertificateRenewalWithResponse(ctx context.Context, isdNumber int, asNumber AS, body PostCertificateRenewalJSONRequestBody, reqEditors ...RequestEditorFn) (*PostCertificateRenewalResponse, error) } type PostAuthTokenResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *AccessToken - JSON400 *Problem - JSON401 *Problem - JSON500 *Problem - JSON503 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *AccessToken + ApplicationproblemJSON400 *N400BadRequest + ApplicationproblemJSON401 *N401UnauthorizedError + ApplicationproblemJSON500 *N500InternalServerError + ApplicationproblemJSON503 *N503ServiceUnavailable } // Status returns HTTPResponse.Status @@ -368,11 +368,11 @@ func (r PostAuthTokenResponse) StatusCode() int { } type GetHealthcheckResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *HealthCheckStatus - JSON500 *Problem - JSON503 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *HealthCheckStatus + ApplicationproblemJSON500 *N500InternalServerError + ApplicationproblemJSON503 *N503ServiceUnavailable } // Status returns HTTPResponse.Status @@ -392,14 +392,14 @@ func (r GetHealthcheckResponse) StatusCode() int { } type PostCertificateRenewalResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *RenewalResponse - JSON400 *Problem - JSON401 *Problem - JSON404 *Problem - JSON500 *Problem - JSON503 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *RenewalResponse + ApplicationproblemJSON400 *N400BadRequest + ApplicationproblemJSON401 *N401UnauthorizedError + ApplicationproblemJSON404 *N404NotFound + ApplicationproblemJSON500 *N500InternalServerError + ApplicationproblemJSON503 *N503ServiceUnavailable } // Status returns HTTPResponse.Status @@ -483,32 +483,32 @@ func ParsePostAuthTokenResponse(rsp *http.Response) (*PostAuthTokenResponse, err response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Problem + var dest N400BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest Problem + var dest N401UnauthorizedError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.ApplicationproblemJSON401 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Problem + var dest N500InternalServerError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest + response.ApplicationproblemJSON500 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest Problem + var dest N503ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON503 = &dest + response.ApplicationproblemJSON503 = &dest } @@ -537,18 +537,18 @@ func ParseGetHealthcheckResponse(rsp *http.Response) (*GetHealthcheckResponse, e response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Problem + var dest N500InternalServerError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest + response.ApplicationproblemJSON500 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest Problem + var dest N503ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON503 = &dest + response.ApplicationproblemJSON503 = &dest } @@ -577,39 +577,39 @@ func ParsePostCertificateRenewalResponse(rsp *http.Response) (*PostCertificateRe response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Problem + var dest N400BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest Problem + var dest N401UnauthorizedError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.ApplicationproblemJSON401 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Problem + var dest N404NotFound if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.ApplicationproblemJSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Problem + var dest N500InternalServerError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest + response.ApplicationproblemJSON500 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest Problem + var dest N503ServiceUnavailable if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON503 = &dest + response.ApplicationproblemJSON503 = &dest } diff --git a/private/ca/api/types.gen.go b/private/ca/api/types.gen.go index db9693896e..f438c1a3a3 100644 --- a/private/ca/api/types.gen.go +++ b/private/ca/api/types.gen.go @@ -6,8 +6,8 @@ package api import ( "encoding/json" - "github.com/deepmap/oapi-codegen/pkg/runtime" - openapi_types "github.com/deepmap/oapi-codegen/pkg/types" + "github.com/oapi-codegen/runtime" + openapi_types "github.com/oapi-codegen/runtime/types" ) const ( @@ -133,6 +133,26 @@ type RenewalResponse_CertificateChain struct { union json.RawMessage } +// N400BadRequest Error message encoded as specified in +// [RFC7807](https://tools.ietf.org/html/rfc7807) +type N400BadRequest = Problem + +// N401UnauthorizedError Error message encoded as specified in +// [RFC7807](https://tools.ietf.org/html/rfc7807) +type N401UnauthorizedError = Problem + +// N404NotFound Error message encoded as specified in +// [RFC7807](https://tools.ietf.org/html/rfc7807) +type N404NotFound = Problem + +// N500InternalServerError Error message encoded as specified in +// [RFC7807](https://tools.ietf.org/html/rfc7807) +type N500InternalServerError = Problem + +// N503ServiceUnavailable Error message encoded as specified in +// [RFC7807](https://tools.ietf.org/html/rfc7807) +type N503ServiceUnavailable = Problem + // PostAuthTokenJSONRequestBody defines body for PostAuthToken for application/json ContentType. type PostAuthTokenJSONRequestBody = AccessCredentials @@ -160,7 +180,7 @@ func (t *RenewalResponse_CertificateChain) MergeCertificateChain(v CertificateCh return err } - merged, err := runtime.JsonMerge(b, t.union) + merged, err := runtime.JsonMerge(t.union, b) t.union = merged return err } @@ -186,7 +206,7 @@ func (t *RenewalResponse_CertificateChain) MergeCertificateChainPKCS7(v Certific return err } - merged, err := runtime.JsonMerge(b, t.union) + merged, err := runtime.JsonMerge(t.union, b) t.union = merged return err } diff --git a/private/mgmtapi/cppki/api/BUILD.bazel b/private/mgmtapi/cppki/api/BUILD.bazel index 8e0d5d1f33..aecf1229ae 100644 --- a/private/mgmtapi/cppki/api/BUILD.bazel +++ b/private/mgmtapi/cppki/api/BUILD.bazel @@ -26,8 +26,8 @@ go_library( "//private/storage:go_default_library", "//private/storage/trust:go_default_library", "//private/trust:go_default_library", - "@com_github_deepmap_oapi_codegen//pkg/runtime:go_default_library", # keep "@com_github_go_chi_chi_v5//:go_default_library", # keep + "@com_github_oapi_codegen_runtime//:go_default_library", # keep ], ) diff --git a/private/mgmtapi/cppki/api/client.gen.go b/private/mgmtapi/cppki/api/client.gen.go index 01dc6bb5f3..d47e1534e9 100644 --- a/private/mgmtapi/cppki/api/client.gen.go +++ b/private/mgmtapi/cppki/api/client.gen.go @@ -12,7 +12,7 @@ import ( "net/url" "strings" - "github.com/deepmap/oapi-codegen/pkg/runtime" + "github.com/oapi-codegen/runtime" ) // RequestEditorFn is the function signature for the RequestEditor callback function @@ -198,58 +198,60 @@ func NewGetCertificatesRequest(server string, params *GetCertificatesParams) (*h return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.IsdAs != nil { + if params.IsdAs != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "isd_as", runtime.ParamLocationQuery, *params.IsdAs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "isd_as", runtime.ParamLocationQuery, *params.IsdAs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - } - - if params.ValidAt != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "valid_at", runtime.ParamLocationQuery, *params.ValidAt); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.ValidAt != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "valid_at", runtime.ParamLocationQuery, *params.ValidAt); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - if params.All != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.All != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -345,42 +347,44 @@ func NewGetTrcsRequest(server string, params *GetTrcsParams) (*http.Request, err return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.Isd != nil { + if params.Isd != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", false, "isd", runtime.ParamLocationQuery, *params.Isd); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", false, "isd", runtime.ParamLocationQuery, *params.Isd); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - if params.All != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.All != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "all", runtime.ParamLocationQuery, *params.All); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -528,30 +532,30 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetCertificates request + // GetCertificatesWithResponse request GetCertificatesWithResponse(ctx context.Context, params *GetCertificatesParams, reqEditors ...RequestEditorFn) (*GetCertificatesResponse, error) - // GetCertificate request + // GetCertificateWithResponse request GetCertificateWithResponse(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*GetCertificateResponse, error) - // GetCertificateBlob request + // GetCertificateBlobWithResponse request GetCertificateBlobWithResponse(ctx context.Context, chainId ChainID, reqEditors ...RequestEditorFn) (*GetCertificateBlobResponse, error) - // GetTrcs request + // GetTrcsWithResponse request GetTrcsWithResponse(ctx context.Context, params *GetTrcsParams, reqEditors ...RequestEditorFn) (*GetTrcsResponse, error) - // GetTrc request + // GetTrcWithResponse request GetTrcWithResponse(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*GetTrcResponse, error) - // GetTrcBlob request + // GetTrcBlobWithResponse request GetTrcBlobWithResponse(ctx context.Context, isd int, base int, serial int, reqEditors ...RequestEditorFn) (*GetTrcBlobResponse, error) } type GetCertificatesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]ChainBrief - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *[]ChainBrief + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -571,10 +575,10 @@ func (r GetCertificatesResponse) StatusCode() int { } type GetCertificateResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Chain - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *Chain + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -594,9 +598,9 @@ func (r GetCertificateResponse) StatusCode() int { } type GetCertificateBlobResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -619,7 +623,7 @@ type GetTrcsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *[]TRCBrief - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -642,7 +646,7 @@ type GetTrcResponse struct { Body []byte HTTPResponse *http.Response JSON200 *TRC - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -664,7 +668,7 @@ func (r GetTrcResponse) StatusCode() int { type GetTrcBlobResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -763,7 +767,7 @@ func ParseGetCertificatesResponse(rsp *http.Response) (*GetCertificatesResponse, if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -796,7 +800,7 @@ func ParseGetCertificateResponse(rsp *http.Response) (*GetCertificateResponse, e if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -822,7 +826,7 @@ func ParseGetCertificateBlobResponse(rsp *http.Response) (*GetCertificateBlobRes if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -851,7 +855,7 @@ func ParseGetTrcsResponse(rsp *http.Response) (*GetTrcsResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -884,7 +888,7 @@ func ParseGetTrcResponse(rsp *http.Response) (*GetTrcResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -910,7 +914,7 @@ func ParseGetTrcBlobResponse(rsp *http.Response) (*GetTrcBlobResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/private/mgmtapi/cppki/api/server.gen.go b/private/mgmtapi/cppki/api/server.gen.go index 55f02bc0e2..9ba0ad5b41 100644 --- a/private/mgmtapi/cppki/api/server.gen.go +++ b/private/mgmtapi/cppki/api/server.gen.go @@ -7,8 +7,8 @@ import ( "fmt" "net/http" - "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/go-chi/chi/v5" + "github.com/oapi-codegen/runtime" ) // ServerInterface represents all server handlers. @@ -33,6 +33,46 @@ type ServerInterface interface { GetTrcBlob(w http.ResponseWriter, r *http.Request, isd int, base int, serial int) } +// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. + +type Unimplemented struct{} + +// List the certificate chains +// (GET /certificates) +func (_ Unimplemented) GetCertificates(w http.ResponseWriter, r *http.Request, params GetCertificatesParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the certificate chain +// (GET /certificates/{chain-id}) +func (_ Unimplemented) GetCertificate(w http.ResponseWriter, r *http.Request, chainId ChainID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the certificate chain blob +// (GET /certificates/{chain-id}/blob) +func (_ Unimplemented) GetCertificateBlob(w http.ResponseWriter, r *http.Request, chainId ChainID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// List the TRCs +// (GET /trcs) +func (_ Unimplemented) GetTrcs(w http.ResponseWriter, r *http.Request, params GetTrcsParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the TRC +// (GET /trcs/isd{isd}-b{base}-s{serial}) +func (_ Unimplemented) GetTrc(w http.ResponseWriter, r *http.Request, isd int, base int, serial int) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the TRC blob +// (GET /trcs/isd{isd}-b{base}-s{serial}/blob) +func (_ Unimplemented) GetTrcBlob(w http.ResponseWriter, r *http.Request, isd int, base int, serial int) { + w.WriteHeader(http.StatusNotImplemented) +} + // ServerInterfaceWrapper converts contexts to parameters. type ServerInterfaceWrapper struct { Handler ServerInterface @@ -75,9 +115,9 @@ func (siw *ServerInterfaceWrapper) GetCertificates(w http.ResponseWriter, r *htt return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetCertificates(w, r, params) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -101,9 +141,9 @@ func (siw *ServerInterfaceWrapper) GetCertificate(w http.ResponseWriter, r *http return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetCertificate(w, r, chainId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -127,9 +167,9 @@ func (siw *ServerInterfaceWrapper) GetCertificateBlob(w http.ResponseWriter, r * return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetCertificateBlob(w, r, chainId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -163,9 +203,9 @@ func (siw *ServerInterfaceWrapper) GetTrcs(w http.ResponseWriter, r *http.Reques return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetTrcs(w, r, params) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -207,9 +247,9 @@ func (siw *ServerInterfaceWrapper) GetTrc(w http.ResponseWriter, r *http.Request return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetTrc(w, r, isd, base, serial) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -251,9 +291,9 @@ func (siw *ServerInterfaceWrapper) GetTrcBlob(w http.ResponseWriter, r *http.Req return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetTrcBlob(w, r, isd, base, serial) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -275,16 +315,16 @@ func (e *UnescapedCookieParamError) Unwrap() error { return e.Err } -type UnmarshallingParamError struct { +type UnmarshalingParamError struct { ParamName string Err error } -func (e *UnmarshallingParamError) Error() string { - return fmt.Sprintf("Error unmarshalling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) } -func (e *UnmarshallingParamError) Unwrap() error { +func (e *UnmarshalingParamError) Unwrap() error { return e.Err } diff --git a/private/mgmtapi/health/api/client.gen.go b/private/mgmtapi/health/api/client.gen.go index d4df7b2bc1..4f1f990cd9 100644 --- a/private/mgmtapi/health/api/client.gen.go +++ b/private/mgmtapi/health/api/client.gen.go @@ -172,7 +172,7 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetHealth request + // GetHealthWithResponse request GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error) } @@ -180,7 +180,7 @@ type GetHealthResponse struct { Body []byte HTTPResponse *http.Response JSON200 *HealthResponse - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -230,7 +230,7 @@ func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error) { response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/private/mgmtapi/health/api/server.gen.go b/private/mgmtapi/health/api/server.gen.go index f21264e57f..97abd0b6bf 100644 --- a/private/mgmtapi/health/api/server.gen.go +++ b/private/mgmtapi/health/api/server.gen.go @@ -17,6 +17,16 @@ type ServerInterface interface { GetHealth(w http.ResponseWriter, r *http.Request) } +// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. + +type Unimplemented struct{} + +// Indicate the service health. +// (GET /health) +func (_ Unimplemented) GetHealth(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // ServerInterfaceWrapper converts contexts to parameters. type ServerInterfaceWrapper struct { Handler ServerInterface @@ -30,9 +40,9 @@ type MiddlewareFunc func(http.Handler) http.Handler func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetHealth(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -54,16 +64,16 @@ func (e *UnescapedCookieParamError) Unwrap() error { return e.Err } -type UnmarshallingParamError struct { +type UnmarshalingParamError struct { ParamName string Err error } -func (e *UnmarshallingParamError) Error() string { - return fmt.Sprintf("Error unmarshalling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) } -func (e *UnmarshallingParamError) Unwrap() error { +func (e *UnmarshalingParamError) Unwrap() error { return e.Err } diff --git a/private/mgmtapi/segments/api/BUILD.bazel b/private/mgmtapi/segments/api/BUILD.bazel index ef2a43e8df..c7370ad4c9 100644 --- a/private/mgmtapi/segments/api/BUILD.bazel +++ b/private/mgmtapi/segments/api/BUILD.bazel @@ -23,8 +23,8 @@ go_library( "//pkg/segment:go_default_library", "//private/mgmtapi:go_default_library", "//private/pathdb/query:go_default_library", - "@com_github_deepmap_oapi_codegen//pkg/runtime:go_default_library", # keep "@com_github_go_chi_chi_v5//:go_default_library", # keep + "@com_github_oapi_codegen_runtime//:go_default_library", # keep "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/private/mgmtapi/segments/api/client.gen.go b/private/mgmtapi/segments/api/client.gen.go index b0f6e2ca31..795cdc14a3 100644 --- a/private/mgmtapi/segments/api/client.gen.go +++ b/private/mgmtapi/segments/api/client.gen.go @@ -12,7 +12,7 @@ import ( "net/url" "strings" - "github.com/deepmap/oapi-codegen/pkg/runtime" + "github.com/oapi-codegen/runtime" ) // RequestEditorFn is the function signature for the RequestEditor callback function @@ -153,42 +153,44 @@ func NewGetSegmentsRequest(server string, params *GetSegmentsParams) (*http.Requ return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.StartIsdAs != nil { + if params.StartIsdAs != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_isd_as", runtime.ParamLocationQuery, *params.StartIsdAs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_isd_as", runtime.ParamLocationQuery, *params.StartIsdAs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - } - - if params.EndIsdAs != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_isd_as", runtime.ParamLocationQuery, *params.EndIsdAs); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.EndIsdAs != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_isd_as", runtime.ParamLocationQuery, *params.EndIsdAs); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -308,21 +310,21 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetSegments request + // GetSegmentsWithResponse request GetSegmentsWithResponse(ctx context.Context, params *GetSegmentsParams, reqEditors ...RequestEditorFn) (*GetSegmentsResponse, error) - // GetSegment request + // GetSegmentWithResponse request GetSegmentWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetSegmentResponse, error) - // GetSegmentBlob request + // GetSegmentBlobWithResponse request GetSegmentBlobWithResponse(ctx context.Context, segmentId SegmentID, reqEditors ...RequestEditorFn) (*GetSegmentBlobResponse, error) } type GetSegmentsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]SegmentBrief - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *[]SegmentBrief + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -342,10 +344,10 @@ func (r GetSegmentsResponse) StatusCode() int { } type GetSegmentResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Segment - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *Segment + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -365,9 +367,9 @@ func (r GetSegmentResponse) StatusCode() int { } type GetSegmentBlobResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -439,7 +441,7 @@ func ParseGetSegmentsResponse(rsp *http.Response) (*GetSegmentsResponse, error) if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -472,7 +474,7 @@ func ParseGetSegmentResponse(rsp *http.Response) (*GetSegmentResponse, error) { if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -498,7 +500,7 @@ func ParseGetSegmentBlobResponse(rsp *http.Response) (*GetSegmentBlobResponse, e if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } diff --git a/private/mgmtapi/segments/api/server.gen.go b/private/mgmtapi/segments/api/server.gen.go index b27cd475d6..28cffab75e 100644 --- a/private/mgmtapi/segments/api/server.gen.go +++ b/private/mgmtapi/segments/api/server.gen.go @@ -7,8 +7,8 @@ import ( "fmt" "net/http" - "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/go-chi/chi/v5" + "github.com/oapi-codegen/runtime" ) // ServerInterface represents all server handlers. @@ -24,6 +24,28 @@ type ServerInterface interface { GetSegmentBlob(w http.ResponseWriter, r *http.Request, segmentId SegmentID) } +// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. + +type Unimplemented struct{} + +// List the SCION path segments +// (GET /segments) +func (_ Unimplemented) GetSegments(w http.ResponseWriter, r *http.Request, params GetSegmentsParams) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the SCION path segment description +// (GET /segments/{segment-id}) +func (_ Unimplemented) GetSegment(w http.ResponseWriter, r *http.Request, segmentId SegmentID) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get the SCION path segment blob +// (GET /segments/{segment-id}/blob) +func (_ Unimplemented) GetSegmentBlob(w http.ResponseWriter, r *http.Request, segmentId SegmentID) { + w.WriteHeader(http.StatusNotImplemented) +} + // ServerInterfaceWrapper converts contexts to parameters. type ServerInterfaceWrapper struct { Handler ServerInterface @@ -58,9 +80,9 @@ func (siw *ServerInterfaceWrapper) GetSegments(w http.ResponseWriter, r *http.Re return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSegments(w, r, params) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -84,9 +106,9 @@ func (siw *ServerInterfaceWrapper) GetSegment(w http.ResponseWriter, r *http.Req return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSegment(w, r, segmentId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -110,9 +132,9 @@ func (siw *ServerInterfaceWrapper) GetSegmentBlob(w http.ResponseWriter, r *http return } - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetSegmentBlob(w, r, segmentId) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -134,16 +156,16 @@ func (e *UnescapedCookieParamError) Unwrap() error { return e.Err } -type UnmarshallingParamError struct { +type UnmarshalingParamError struct { ParamName string Err error } -func (e *UnmarshallingParamError) Error() string { - return fmt.Sprintf("Error unmarshalling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) } -func (e *UnmarshallingParamError) Unwrap() error { +func (e *UnmarshalingParamError) Unwrap() error { return e.Err } diff --git a/router/mgmtapi/BUILD.bazel b/router/mgmtapi/BUILD.bazel index 887c65731b..9d5f487598 100644 --- a/router/mgmtapi/BUILD.bazel +++ b/router/mgmtapi/BUILD.bazel @@ -32,10 +32,9 @@ go_library( "//pkg/addr:go_default_library", "//private/mgmtapi:go_default_library", "//router/control:go_default_library", - "@com_github_deepmap_oapi_codegen//pkg/runtime:go_default_library", # keep "@com_github_getkin_kin_openapi//openapi3:go_default_library", # keep "@com_github_go_chi_chi_v5//:go_default_library", # keep - "@com_github_pkg_errors//:go_default_library", # keep + "@com_github_oapi_codegen_runtime//:go_default_library", # keep ], ) diff --git a/router/mgmtapi/client.gen.go b/router/mgmtapi/client.gen.go index a9f43f3109..c6c6c0fb4a 100644 --- a/router/mgmtapi/client.gen.go +++ b/router/mgmtapi/client.gen.go @@ -99,7 +99,7 @@ type ClientInterface interface { // GetLogLevel request GetLogLevel(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // SetLogLevel request with any body + // SetLogLevelWithBody request with any body SetLogLevelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) SetLogLevel(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -368,19 +368,19 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetConfig request + // GetConfigWithResponse request GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error) - // GetInfo request + // GetInfoWithResponse request GetInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInfoResponse, error) - // GetInterfaces request + // GetInterfacesWithResponse request GetInterfacesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetInterfacesResponse, error) - // GetLogLevel request + // GetLogLevelWithResponse request GetLogLevelWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLogLevelResponse, error) - // SetLogLevel request with any body + // SetLogLevelWithBodyWithResponse request with any body SetLogLevelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error) SetLogLevelWithResponse(ctx context.Context, body SetLogLevelJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLogLevelResponse, error) @@ -389,7 +389,7 @@ type ClientWithResponsesInterface interface { type GetConfigResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -411,7 +411,7 @@ func (r GetConfigResponse) StatusCode() int { type GetInfoResponse struct { Body []byte HTTPResponse *http.Response - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -431,10 +431,10 @@ func (r GetInfoResponse) StatusCode() int { } type GetInterfacesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *InterfacesResponse - JSON400 *Problem + Body []byte + HTTPResponse *http.Response + JSON200 *InterfacesResponse + ApplicationproblemJSON400 *Problem } // Status returns HTTPResponse.Status @@ -457,7 +457,7 @@ type GetLogLevelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LogLevel - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -480,7 +480,7 @@ type SetLogLevelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *LogLevel - JSON400 *StandardError + JSON400 *BadRequest } // Status returns HTTPResponse.Status @@ -567,7 +567,7 @@ func ParseGetConfigResponse(rsp *http.Response) (*GetConfigResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -593,7 +593,7 @@ func ParseGetInfoResponse(rsp *http.Response) (*GetInfoResponse, error) { switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -630,7 +630,7 @@ func ParseGetInterfacesResponse(rsp *http.Response) (*GetInterfacesResponse, err if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.ApplicationproblemJSON400 = &dest } @@ -659,7 +659,7 @@ func ParseGetLogLevelResponse(rsp *http.Response) (*GetLogLevelResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -692,7 +692,7 @@ func ParseSetLogLevelResponse(rsp *http.Response) (*SetLogLevelResponse, error) response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest StandardError + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } diff --git a/router/mgmtapi/server.gen.go b/router/mgmtapi/server.gen.go index 0743b7dac2..cc1aa483a0 100644 --- a/router/mgmtapi/server.gen.go +++ b/router/mgmtapi/server.gen.go @@ -29,6 +29,40 @@ type ServerInterface interface { SetLogLevel(w http.ResponseWriter, r *http.Request) } +// Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. + +type Unimplemented struct{} + +// Prints the TOML configuration file. +// (GET /config) +func (_ Unimplemented) GetConfig(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Basic information page about the control service process. +// (GET /info) +func (_ Unimplemented) GetInfo(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// List the SCION interfaces +// (GET /interfaces) +func (_ Unimplemented) GetInterfaces(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Get logging level +// (GET /log/level) +func (_ Unimplemented) GetLogLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + +// Set logging level +// (PUT /log/level) +func (_ Unimplemented) SetLogLevel(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotImplemented) +} + // ServerInterfaceWrapper converts contexts to parameters. type ServerInterfaceWrapper struct { Handler ServerInterface @@ -42,9 +76,9 @@ type MiddlewareFunc func(http.Handler) http.Handler func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetConfig(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -57,9 +91,9 @@ func (siw *ServerInterfaceWrapper) GetConfig(w http.ResponseWriter, r *http.Requ func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetInfo(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -72,9 +106,9 @@ func (siw *ServerInterfaceWrapper) GetInfo(w http.ResponseWriter, r *http.Reques func (siw *ServerInterfaceWrapper) GetInterfaces(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetInterfaces(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -87,9 +121,9 @@ func (siw *ServerInterfaceWrapper) GetInterfaces(w http.ResponseWriter, r *http. func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.GetLogLevel(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -102,9 +136,9 @@ func (siw *ServerInterfaceWrapper) GetLogLevel(w http.ResponseWriter, r *http.Re func (siw *ServerInterfaceWrapper) SetLogLevel(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { siw.Handler.SetLogLevel(w, r) - }) + })) for _, middleware := range siw.HandlerMiddlewares { handler = middleware(handler) @@ -126,16 +160,16 @@ func (e *UnescapedCookieParamError) Unwrap() error { return e.Err } -type UnmarshallingParamError struct { +type UnmarshalingParamError struct { ParamName string Err error } -func (e *UnmarshallingParamError) Error() string { - return fmt.Sprintf("Error unmarshalling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) +func (e *UnmarshalingParamError) Error() string { + return fmt.Sprintf("Error unmarshaling parameter %s as JSON: %s", e.ParamName, e.Err.Error()) } -func (e *UnmarshallingParamError) Unwrap() error { +func (e *UnmarshalingParamError) Unwrap() error { return e.Err } diff --git a/router/mgmtapi/spec.gen.go b/router/mgmtapi/spec.gen.go index b292ce8fb1..a344f75ee9 100644 --- a/router/mgmtapi/spec.gen.go +++ b/router/mgmtapi/spec.gen.go @@ -64,16 +64,16 @@ var swaggerSpec = []string{ func decodeSpec() ([]byte, error) { zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) if err != nil { - return nil, fmt.Errorf("error base64 decoding spec: %s", err) + return nil, fmt.Errorf("error base64 decoding spec: %w", err) } zr, err := gzip.NewReader(bytes.NewReader(zipped)) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } var buf bytes.Buffer _, err = buf.ReadFrom(zr) if err != nil { - return nil, fmt.Errorf("error decompressing spec: %s", err) + return nil, fmt.Errorf("error decompressing spec: %w", err) } return buf.Bytes(), nil @@ -91,7 +91,7 @@ func decodeSpecCached() func() ([]byte, error) { // Constructs a synthetic filesystem for resolving external references when loading openapi specifications. func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - var res = make(map[string]func() ([]byte, error)) + res := make(map[string]func() ([]byte, error)) if len(pathToFile) > 0 { res[pathToFile] = rawSpec } @@ -105,12 +105,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { // Externally referenced files must be embedded in the corresponding golang packages. // Urls can be supported but this task was out of the scope. func GetSwagger() (swagger *openapi3.T, err error) { - var resolvePath = PathToRawSpec("") + resolvePath := PathToRawSpec("") loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - var pathToFile = url.String() + pathToFile := url.String() pathToFile = path.Clean(pathToFile) getSpec, ok := resolvePath[pathToFile] if !ok { diff --git a/rules_openapi/internal/generate.bzl b/rules_openapi/internal/generate.bzl index 8b2cda5f2c..9a03533e6b 100644 --- a/rules_openapi/internal/generate.bzl +++ b/rules_openapi/internal/generate.bzl @@ -81,9 +81,9 @@ openapi_generate_go = rule( ), "_oapi_codegen": attr.label( doc = "The code generator binary.", - default = "@com_github_deepmap_oapi_codegen//cmd/oapi-codegen:oapi-codegen", + default = "@com_github_deepmap_oapi_codegen_v2//cmd/oapi-codegen:oapi-codegen", executable = True, - cfg = "target", + cfg = "exec", ), "out_types": attr.output( doc = "The generated types file.", diff --git a/rules_openapi/internal/tools.go b/rules_openapi/internal/tools.go new file mode 100644 index 0000000000..618a3b556d --- /dev/null +++ b/rules_openapi/internal/tools.go @@ -0,0 +1,24 @@ +// Copyright 2023 SCION Association +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build tools + +package rulesopenapi + +import ( + // The bazel rule openapi_generate_go uses oapi-codegen as a build tool. + // As an easy way to ensure that we have all the appropriate dependencies, + // import it here in this dummy go file. + _ "github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen" +)