From dc1eee91702acbba7300b801e31d6cb38bd17c1f Mon Sep 17 00:00:00 2001 From: fjviera Date: Mon, 14 Jun 2021 17:59:02 +0200 Subject: [PATCH 01/41] Add dynamick client registration --- client/handler.go | 227 +++++++++++++++++- client/sdk_test.go | 7 +- client/validator.go | 28 +++ client/validator_test.go | 74 ++++++ .../openid/dynamic_client_registration.js | 110 +++++++++ docs/docs/reference/configuration.md | 13 + driver/config/provider.go | 17 ++ driver/config/provider_test.go | 15 ++ driver/registry_base.go | 2 +- go.mod | 2 + go.sum | 9 +- internal/.hydra.yaml | 1 + internal/config/config.yaml | 2 + quickstart-postgres.yml | 20 +- spec/config.json | 8 +- test/e2e/circle-ci.env.bash | 19 ++ 16 files changed, 534 insertions(+), 20 deletions(-) create mode 100644 cypress/integration/openid/dynamic_client_registration.js create mode 100755 test/e2e/circle-ci.env.bash diff --git a/client/handler.go b/client/handler.go index 5cbc4f33598..7e8f6a37da7 100644 --- a/client/handler.go +++ b/client/handler.go @@ -27,6 +27,9 @@ import ( "net/http" "time" + "github.com/Jeffail/gabs/v2" + "github.com/ory/x/sqlxx" + "github.com/ory/x/errorsx" "github.com/ory/herodot" @@ -54,13 +57,20 @@ func NewHandler(r InternalRegistry) *Handler { } } -func (h *Handler) SetRoutes(admin *x.RouterAdmin) { +func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic, dynamicRegistration bool) { admin.GET(ClientsHandlerPath, h.List) admin.POST(ClientsHandlerPath, h.Create) admin.GET(ClientsHandlerPath+"/:id", h.Get) admin.PUT(ClientsHandlerPath+"/:id", h.Update) admin.PATCH(ClientsHandlerPath+"/:id", h.Patch) admin.DELETE(ClientsHandlerPath+"/:id", h.Delete) + + if dynamicRegistration { + public.POST(ClientsHandlerPath, h.CreateDynamicRegistration) + public.GET(ClientsHandlerPath+"/:id", h.GetDynamicRegistration) + public.PUT(ClientsHandlerPath+"/:id", h.UpdateDynamicRegistration) + public.DELETE(ClientsHandlerPath+"/:id", h.DeleteDynamicRegistration) + } } // swagger:route POST /clients admin createOAuth2Client @@ -122,6 +132,70 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Pa h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &c) } +// swagger:route POST /clients public createOAuth2Client +// +// Create an OAuth 2.0 Client +// +// Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. +// +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// Schemes: http, https +// +// Responses: +// 201: oAuth2Client +// 400: genericError +// 409: genericError +// 500: genericError +func (h *Handler) CreateDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { + var c Client + + if err := json.NewDecoder(r.Body).Decode(&c); err != nil { + h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) + return + } + + if err := h.r.ClientValidator().ValidateDynamicRegistration(&c); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + if len(c.Secret) == 0 { + secretb, err := x.GenerateSecret(26) + if err != nil { + h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) + return + } + c.Secret = string(secretb) + } + + if err := h.r.ClientValidator().Validate(&c); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + secret := c.Secret + c.CreatedAt = time.Now().UTC().Round(time.Second) + c.UpdatedAt = c.CreatedAt + if err := h.r.ClientManager().CreateClient(r.Context(), &c); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + c.Secret = "" + if !c.IsPublic() { + c.Secret = secret + } + h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &c) +} + // swagger:route PUT /clients/{id} admin updateOAuth2Client // // Update an OAuth 2.0 Client @@ -221,6 +295,64 @@ func (h *Handler) updateClient(ctx context.Context, c *Client) error { return nil } +// swagger:route PUT /clients/{id} public updateOAuth2Client +// +// Update an OAuth 2.0 Client +// +// Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. +// +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// Schemes: http, https +// +// Responses: +// 200: oAuth2Client +// 500: genericError +func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { + var c Client + + if err := json.NewDecoder(r.Body).Decode(&c); err != nil { + h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) + return + } + + var secret string + if len(c.Secret) > 0 { + secret = c.Secret + } + if _, err := h.r.ClientManager().Authenticate(r.Context(), ps.ByName("id"), []byte(secret)); err != nil { + err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") + h.r.Writer().WriteError(w, r, err) + return + } + + if err := h.r.ClientValidator().ValidateDynamicRegistration(&c); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + c.OutfacingID = ps.ByName("id") + if err := h.r.ClientValidator().Validate(&c); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + c.UpdatedAt = time.Now().UTC().Round(time.Second) + if err := h.r.ClientManager().UpdateClient(r.Context(), &c); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + c.Secret = secret + h.r.Writer().Write(w, r, &c) +} + // swagger:route GET /clients admin listOAuth2Clients // // List OAuth 2.0 Clients @@ -307,6 +439,60 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para h.r.Writer().Write(w, r, c) } +// swagger:route GET /clients/{id} public getOAuth2Client +// +// Get an OAuth 2.0 Client. +// +// Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. +// +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// Schemes: http, https +// +// Responses: +// 200: oAuth2Client +// 401: genericError +// 500: genericError +func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { + var id = ps.ByName("id") + var secret = r.URL.Query()["secret"][0] + + c, err := h.r.ClientManager().Authenticate(r.Context(), id, []byte(secret)) + if err != nil { + err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") + h.r.Writer().WriteError(w, r, err) + return + } + + c.Secret = "" + if c.Metadata != nil { + jsonParsed, err := gabs.ParseJSON(c.Metadata) + if err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + _, ok := jsonParsed.Path("access_token_ttl").Data().(float64) + if ok { + jsonParsed.Delete("access_token_ttl") + } + + _, ok = jsonParsed.Path("id_token_ttl").Data().(float64) + if ok { + jsonParsed.Delete("id_token_ttl") + } + c.Metadata = sqlxx.JSONRawMessage(jsonParsed.String()) + } + h.r.Writer().Write(w, r, c) +} + // swagger:route DELETE /clients/{id} admin deleteOAuth2Client // // Deletes an OAuth 2.0 Client @@ -337,3 +523,42 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P w.WriteHeader(http.StatusNoContent) } + +// swagger:route DELETE /clients/{id} public deleteOAuth2Client +// +// Deletes an OAuth 2.0 Client +// +// Delete an existing OAuth 2.0 Client by its ID. +// +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// Schemes: http, https +// +// Responses: +// 204: emptyResponse +// 404: genericError +// 500: genericError +func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { + var id = ps.ByName("id") + var secret = r.URL.Query()["secret"][0] + + _, err := h.r.ClientManager().Authenticate(r.Context(), id, []byte(secret)) + if err != nil { + err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") + h.r.Writer().WriteError(w, r, err) + return + } + + if err := h.r.ClientManager().DeleteClient(r.Context(), id); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + w.WriteHeader(http.StatusNoContent) +} diff --git a/client/sdk_test.go b/client/sdk_test.go index 944ff7880ac..3c17d8c13e5 100644 --- a/client/sdk_test.go +++ b/client/sdk_test.go @@ -82,10 +82,11 @@ func TestClientSDK(t *testing.T) { conf.MustSet(config.KeyDefaultClientScope, []string{"foo", "bar"}) r := internal.NewRegistryMemory(t, conf) - router := x.NewRouterAdmin() + routerAdmin := x.NewRouterAdmin() + routerPublic := x.NewRouterPublic() handler := client.NewHandler(r) - handler.SetRoutes(router) - server := httptest.NewServer(router) + handler.SetRoutes(routerAdmin, routerPublic, true) + server := httptest.NewServer(routerAdmin) c := hydra.NewHTTPClientWithConfig(nil, &hydra.TransportConfig{Schemes: []string{"http"}, Host: urlx.ParseOrPanic(server.URL).Host}) diff --git a/client/validator.go b/client/validator.go index 81466773b56..b8fd72f475b 100644 --- a/client/validator.go +++ b/client/validator.go @@ -33,6 +33,7 @@ import ( "github.com/pborman/uuid" + "github.com/Jeffail/gabs/v2" "github.com/ory/x/stringslice" "github.com/ory/x/stringsx" ) @@ -186,6 +187,33 @@ func (v *Validator) Validate(c *Client) error { return nil } +func (v *Validator) ValidateDynamicRegistration(c *Client) error { + + if c.Metadata != nil { + jsonParsed, err := gabs.ParseJSON(c.Metadata) + if err != nil { + return errorsx.WithStack(ErrInvalidClientMetadata. + WithHintf(`metadata "%v" cannot be parsed'`, c.Metadata), + ) + } + + _, ok := jsonParsed.Path("access_token_ttl").Data().(float64) + if ok { + return errorsx.WithStack(ErrInvalidClientMetadata. + WithHint(`access_token_ttl cannot be set for dynamic client registration'`), + ) + } + + _, ok = jsonParsed.Path("id_token_ttl").Data().(float64) + if ok { + return errorsx.WithStack(ErrInvalidClientMetadata. + WithHint(`id_token_ttl cannot be set for dynamic client registration'`), + ) + } + } + return nil +} + func (v *Validator) ValidateSectorIdentifierURL(location string, redirectURIs []string) error { l, err := url.Parse(location) if err != nil { diff --git a/client/validator_test.go b/client/validator_test.go index 1348ad99ff8..49cb6bd08c6 100644 --- a/client/validator_test.go +++ b/client/validator_test.go @@ -22,6 +22,7 @@ package client_test import ( "fmt" + "github.com/Jeffail/gabs/v2" "net/http" "net/http/httptest" "testing" @@ -199,3 +200,76 @@ func TestValidateSectorIdentifierURL(t *testing.T) { }) } } + +func TestValidateDynamicRegistration(t *testing.T) { + c := internal.NewConfigurationWithDefaults() + c.MustSet(config.KeySubjectTypesSupported, []string{"pairwise", "public"}) + c.MustSet(config.KeyDefaultClientScope, []string{"openid"}) + + v := NewValidator(c) + for k, tc := range []struct { + in *Client + check func(t *testing.T, c *Client) + expectErr bool + v func(t *testing.T) *Validator + }{ + { + in: &Client{ + OutfacingID: "foo", + PostLogoutRedirectURIs: []string{"https://foo/"}, + RedirectURIs: []string{"https://foo/"}, + Metadata: []byte("{\"access_token_ttl\":10}"), + }, + expectErr: true, + }, + { + in: &Client{ + OutfacingID: "foo", + PostLogoutRedirectURIs: []string{"https://foo/"}, + RedirectURIs: []string{"https://foo/"}, + Metadata: []byte("{\"id_token_ttl\":10}"), + }, + expectErr: true, + }, + { + in: &Client{ + OutfacingID: "foo", + PostLogoutRedirectURIs: []string{"https://foo/"}, + RedirectURIs: []string{"https://foo/"}, + Metadata: []byte("{\"anything\":10}"), + }, + check: func(t *testing.T, c *Client) { + jsonParsed, err := gabs.ParseJSON(c.Metadata) + assert.Nil(t, err) + val, ok := jsonParsed.Path("anything").Data().(float64) + assert.Equal(t, float64(10), val) + assert.Equal(t, true, ok) + }, + }, + { + in: &Client{ + OutfacingID: "foo", + PostLogoutRedirectURIs: []string{"https://foo/"}, + RedirectURIs: []string{"https://foo/"}, + }, + check: func(t *testing.T, c *Client) { + assert.Equal(t, "foo", c.OutfacingID) + }, + }, + } { + t.Run(fmt.Sprintf("case=%d", k), func(t *testing.T) { + if tc.v == nil { + tc.v = func(t *testing.T) *Validator { + return v + } + } + err := tc.v(t).ValidateDynamicRegistration(tc.in) + if tc.expectErr { + require.Error(t, err) + } else { + require.NoError(t, err) + tc.check(t, tc.in) + } + }) + } +} diff --git a/cypress/integration/openid/dynamic_client_registration.js b/cypress/integration/openid/dynamic_client_registration.js new file mode 100644 index 00000000000..97b6538b087 --- /dev/null +++ b/cypress/integration/openid/dynamic_client_registration.js @@ -0,0 +1,110 @@ +import { prng } from '../../helpers' + +describe('The Clients Pubic Interface', function () { + + it('should return same client_secret given in request for newly created clients with client_secret specified', function () { + + cy.request({ + method: 'POST', + url: Cypress.env('public_url') + '/clients', + body: { + client_id: 'clientid', + client_name: 'clientName', + client_secret: 'secret', + scope: 'foo openid offline_access', + grant_types: [ + 'client_credentials' + ] + } + }).then((response) => { + console.log(response.body) + expect(response.body.client_secret).to.equal('secret') + }) + }) + + it('should get client when having a valid client_secret in body', function () { + + cy.request({ + method: 'GET', + url: Cypress.env('public_url') + '/clients/clientid?secret=secret' + }).then((response) => { + console.log(response.body) + expect(response.body.client_name).to.equal('clientName') + }) + }) + + it('should fail for get client when having an invalid client_secret in body', function () { + + cy.request({ + method: 'GET', + failOnStatusCode: false, + url: Cypress.env('public_url') + '/clients/clientid?secret=wrongsecret' + }).then((response) => { + expect(response.status).to.eq(401); + }) + }) + + it('should update client name when having a valid client_secret in body', function () { + + cy.request({ + method: 'PUT', + url: Cypress.env('public_url') + '/clients/clientid', + body: { + client_id: 'clientid', + client_name: 'clientName2', + client_secret: 'secret', + scope: 'foo openid offline_access', + grant_types: [ + 'client_credentials' + ] + } + }).then((response) => { + console.log(response.body) + expect(response.body.client_name).to.equal('clientName2') + }) + }) + + it('should fail to update client name when having an invalid client_secret in body', function () { + + cy.request({ + method: 'PUT', + failOnStatusCode: false, + url: Cypress.env('public_url') + '/clients/clientid', + body: { + client_id: 'clientid', + client_name: 'clientName2', + client_secret: 'wrongsecret', + scope: 'foo openid offline_access', + grant_types: [ + 'client_credentials' + ] + } + }).then((response) => { + expect(response.status).to.eq(401); + }) + }) + + it('should fail to delete client when having an invalid client_secret as parameter body', function () { + + cy.request({ + method: 'DELETE', + failOnStatusCode: false, + url: Cypress.env('public_url') + '/clients/clientid?secret=wrongsecret' + }).then((response) => { + expect(response.status).to.eq(401); + }) + }) + + it('should delete client when having an valid client_secret as parameter body', function () { + + cy.request({ + method: 'DELETE', + failOnStatusCode: false, + url: Cypress.env('public_url') + '/clients/clientid?secret=secret' + }).then((response) => { + expect(response.status).to.eq(204); + }) + }) + + +}) diff --git a/docs/docs/reference/configuration.md b/docs/docs/reference/configuration.md index 16863b1f890..b34b983ff7f 100644 --- a/docs/docs/reference/configuration.md +++ b/docs/docs/reference/configuration.md @@ -689,6 +689,19 @@ serve: # path: /path/to/file.pem + ## allow_dynamic_registration ## + # + # Allow oidc dynamic client registration. + # + # Default value: false + # + # Set this value using environment variables on + # - Linux/macOS: + # $ export SERVE_PUBLIC_ALLOW_DYNAMIC_REGISTRATION= + # - Windows Command Line (CMD): + # > set SERVE_PUBLIC_ALLOW_DYNAMIC_REGISTRATION= + # + allow_dynamic_registration: false ## port ## # # Default value: 4444 diff --git a/driver/config/provider.go b/driver/config/provider.go index 56cbb88b7ce..1c111d73d08 100644 --- a/driver/config/provider.go +++ b/driver/config/provider.go @@ -37,6 +37,19 @@ const ( KeyDSN = "dsn" KeyBCryptCost = "oauth2.hashers.bcrypt.cost" KeyEncryptSessionData = "oauth2.session.encrypt_at_rest" + KeyAdminListenOnHost = "serve.admin.host" + KeyAdminListenOnPort = "serve.admin.port" + KeyAdminSocketOwner = "serve.admin.socket.owner" + KeyAdminSocketGroup = "serve.admin.socket.group" + KeyAdminSocketMode = "serve.admin.socket.mode" + KeyAdminDisableHealthAccessLog = "serve.admin.access_log.disable_for_health" + KeyPublicListenOnHost = "serve.public.host" + KeyPublicListenOnPort = "serve.public.port" + KeyPublicSocketOwner = "serve.public.socket.owner" + KeyPublicSocketGroup = "serve.public.socket.group" + KeyPublicSocketMode = "serve.public.socket.mode" + KeyPublicDisableHealthAccessLog = "serve.public.access_log.disable_for_health" + KeyPublicAllowDynamicRegistration = "serve.public.allow_dynamic_registration" KeyCookieSameSiteMode = "serve.cookies.same_site_mode" KeyCookieSameSiteLegacyWorkaround = "serve.cookies.same_site_legacy_workaround" KeyConsentRequestMaxAge = "ttl.login_consent_request" @@ -216,6 +229,10 @@ func (p *Provider) CookieSameSiteMode() http.SameSite { } } +func (p *Provider) PublicAllowDynamicRegistration() bool { + return p.p.Bool(KeyPublicAllowDynamicRegistration) +} + func (p *Provider) CookieSameSiteLegacyWorkaround() bool { return p.p.Bool(KeyCookieSameSiteLegacyWorkaround) } diff --git a/driver/config/provider_test.go b/driver/config/provider_test.go index 5859364ea86..b8f8a365d63 100644 --- a/driver/config/provider_test.go +++ b/driver/config/provider_test.go @@ -134,6 +134,21 @@ func TestProviderPublicDisableHealthAccessLog(t *testing.T) { assert.Equal(t, true, value) } +func TestPublicAllowDynamicRegistration(t *testing.T) { + l := logrusx.New("", "") + l.Logrus().SetOutput(ioutil.Discard) + + p := MustNew(l) + + value := p.PublicAllowDynamicRegistration() + assert.Equal(t, false, value) + + p.MustSet(KeyPublicAllowDynamicRegistration, "true") + + value = p.PublicAllowDynamicRegistration() + assert.Equal(t, true, value) +} + func TestProviderIssuerURL(t *testing.T) { l := logrusx.New("", "") l.Logrus().SetOutput(ioutil.Discard) diff --git a/driver/registry_base.go b/driver/registry_base.go index e1013c76729..492bbba663f 100644 --- a/driver/registry_base.go +++ b/driver/registry_base.go @@ -105,7 +105,7 @@ func (m *RegistryBase) RegisterRoutes(admin *x.RouterAdmin, public *x.RouterPubl m.ConsentHandler().SetRoutes(admin) m.KeyHandler().SetRoutes(admin, public, m.OAuth2AwareMiddleware()) - m.ClientHandler().SetRoutes(admin) + m.ClientHandler().SetRoutes(admin, public, m.C.PublicAllowDynamicRegistration()) m.OAuth2Handler().SetRoutes(admin, public, m.OAuth2AwareMiddleware()) } diff --git a/go.mod b/go.mod index cb339de82e0..165d709b431 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,8 @@ replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 require ( github.com/DataDog/datadog-go v4.6.0+incompatible // indirect + github.com/HdrHistogram/hdrhistogram-go v1.0.0 // indirect + github.com/Jeffail/gabs/v2 v2.6.1 // indirect github.com/cenkalti/backoff/v3 v3.0.0 github.com/containerd/containerd v1.4.4 // indirect github.com/evanphx/json-patch v0.5.2 diff --git a/go.sum b/go.sum index d665ad002c3..edb02c04ed6 100644 --- a/go.sum +++ b/go.sum @@ -36,6 +36,7 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= @@ -47,6 +48,11 @@ github.com/HdrHistogram/hdrhistogram-go v1.0.1/go.mod h1:BWJ+nMSHY3L41Zj7CA3uXnl github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= +github.com/HdrHistogram/hdrhistogram-go v1.0.0 h1:jivTvI9tBw5B8wW9Qd0uoQ2qaajb29y4TPhYTgh8Lb0= +github.com/HdrHistogram/hdrhistogram-go v1.0.0/go.mod h1:YzE1EgsuAz8q9lfGdlxBZo2Ma655+PfKp2mlzcAqIFw= +github.com/Jeffail/gabs/v2 v2.6.1 h1:wwbE6nTQTwIMsMxzi6XFQQYRZ6wDc1mSdxoAN+9U4Gk= +github.com/Jeffail/gabs/v2 v2.6.1/go.mod h1:xCn81vdHKxFUuWWAaD5jCTQDNPBMh5pPs9IJ+NcziBI= github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.0.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= @@ -71,8 +77,7 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajg/form v0.0.0-20160822230020-523a5da1a92f h1:zvClvFQwU++UpIUBGC8YmDlfhUrweEy1R1Fj1gu5iIM= github.com/ajg/form v0.0.0-20160822230020-523a5da1a92f/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= diff --git a/internal/.hydra.yaml b/internal/.hydra.yaml index 219229f2b2a..11f47550e99 100644 --- a/internal/.hydra.yaml +++ b/internal/.hydra.yaml @@ -27,6 +27,7 @@ serve: debug: false access_log: disable_for_health: false + allow_dynamic_registration: false admin: port: 2 host: localhost diff --git a/internal/config/config.yaml b/internal/config/config.yaml index 22a22812513..c0d8e3784de 100644 --- a/internal/config/config.yaml +++ b/internal/config/config.yaml @@ -141,6 +141,8 @@ serve: access_log: # Disable access log for health endpoints. disable_for_health: false + # Allow oidc dynamic client registration + allow_dynamic_registration: false # admin controls the admin daemon serving admin API endpoints like /jwk, /client, ... admin: diff --git a/quickstart-postgres.yml b/quickstart-postgres.yml index 0ea4dfd0f4b..734679525c7 100644 --- a/quickstart-postgres.yml +++ b/quickstart-postgres.yml @@ -14,16 +14,6 @@ version: '3.7' services: - hydra-migrate: - image: oryd/hydra:v1.10.2 - environment: - - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 - - hydra: - image: oryd/hydra:v1.10.2 - environment: - - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 - postgresd: image: postgres:9.6 ports: @@ -32,5 +22,11 @@ services: - POSTGRES_USER=hydra - POSTGRES_PASSWORD=secret - POSTGRES_DB=hydra - networks: - - intranet + + hydra-migrate: + image: oryd/hydra:v1.9.2 + environment: + - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 + command: + migrate sql -e --yes + restart: on-failure diff --git a/spec/config.json b/spec/config.json index ffbae139da7..cc93c3406c2 100644 --- a/spec/config.json +++ b/spec/config.json @@ -331,6 +331,12 @@ }, "tls": { "$ref": "#/definitions/tls_config" + }, + "allow_dynamic_registration": { + "type": "boolean", + "additionalProperties": false, + "description": "Allow oidc dynamic client registration.", + "default": false } } }, @@ -1113,4 +1119,4 @@ } } } -} \ No newline at end of file +} diff --git a/test/e2e/circle-ci.env.bash b/test/e2e/circle-ci.env.bash new file mode 100755 index 00000000000..053963dd6db --- /dev/null +++ b/test/e2e/circle-ci.env.bash @@ -0,0 +1,19 @@ +#!/bin/bash + +export URLS_SELF_ISSUER=http://127.0.0.1:5000 +export URLS_CONSENT=http://127.0.0.1:5002/consent +export URLS_LOGIN=http://127.0.0.1:5002/login +export URLS_LOGOUT=http://127.0.0.1:5002/logout +export SECRETS_SYSTEM=youReallyNeedToChangeThis +export OIDC_SUBJECT_IDENTIFIERS_SUPPORTED_TYPES=public,pairwise +export OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT=youReallyNeedToChangeThis +export SERVE_PUBLIC_CORS_ENABLED=true +export SERVE_PUBLIC_CORS_ALLOWED_METHODS=POST,GET,PUT,DELETE +export SERVE_ADMIN_CORS_ENABLED=true +export SERVE_ADMIN_CORS_ALLOWED_METHODS=POST,GET,PUT,DELETE +export LOG_LEVEL=trace +export OAUTH2_EXPOSE_INTERNAL_ERRORS=1 +export SERVE_PUBLIC_PORT=5000 +export SERVE_ADMIN_PORT=5001 +export LOG_LEAK_SENSITIVE_VALUES=true +export SERVE_PUBLIC_ALLOW_DYNAMIC_REGISTRATION=true From 37b05c0322fe33b739120b35ab69563c8a0f1f5d Mon Sep 17 00:00:00 2001 From: fjviera Date: Tue, 15 Jun 2021 08:06:03 +0200 Subject: [PATCH 02/41] Add dynamic client registration --- test/e2e/circle-ci.bash | 1 + test/e2e/circle-ci.env.bash | 19 ------------------- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100755 test/e2e/circle-ci.env.bash diff --git a/test/e2e/circle-ci.bash b/test/e2e/circle-ci.bash index 0ac23f849eb..26d76adc5d6 100755 --- a/test/e2e/circle-ci.bash +++ b/test/e2e/circle-ci.bash @@ -54,6 +54,7 @@ export SERVE_PUBLIC_PORT=5000 export SERVE_ADMIN_PORT=5001 export LOG_LEAK_SENSITIVE_VALUES=true export TEST_DATABASE_SQLITE="sqlite://$(mktemp -d -t ci-XXXXXXXXXX)/e2e.sqlite?_fk=true" +export SERVE_PUBLIC_ALLOW_DYNAMIC_REGISTRATION=true WATCH=no for i in "$@" diff --git a/test/e2e/circle-ci.env.bash b/test/e2e/circle-ci.env.bash deleted file mode 100755 index 053963dd6db..00000000000 --- a/test/e2e/circle-ci.env.bash +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -export URLS_SELF_ISSUER=http://127.0.0.1:5000 -export URLS_CONSENT=http://127.0.0.1:5002/consent -export URLS_LOGIN=http://127.0.0.1:5002/login -export URLS_LOGOUT=http://127.0.0.1:5002/logout -export SECRETS_SYSTEM=youReallyNeedToChangeThis -export OIDC_SUBJECT_IDENTIFIERS_SUPPORTED_TYPES=public,pairwise -export OIDC_SUBJECT_IDENTIFIERS_PAIRWISE_SALT=youReallyNeedToChangeThis -export SERVE_PUBLIC_CORS_ENABLED=true -export SERVE_PUBLIC_CORS_ALLOWED_METHODS=POST,GET,PUT,DELETE -export SERVE_ADMIN_CORS_ENABLED=true -export SERVE_ADMIN_CORS_ALLOWED_METHODS=POST,GET,PUT,DELETE -export LOG_LEVEL=trace -export OAUTH2_EXPOSE_INTERNAL_ERRORS=1 -export SERVE_PUBLIC_PORT=5000 -export SERVE_ADMIN_PORT=5001 -export LOG_LEAK_SENSITIVE_VALUES=true -export SERVE_PUBLIC_ALLOW_DYNAMIC_REGISTRATION=true From 4a08095cae85a9ab9385577d09a42952728d7bbf Mon Sep 17 00:00:00 2001 From: fjviera Date: Tue, 15 Jun 2021 08:08:44 +0200 Subject: [PATCH 03/41] Add dynamic client registration --- driver/config/provider.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/driver/config/provider.go b/driver/config/provider.go index 1c111d73d08..cabca82a949 100644 --- a/driver/config/provider.go +++ b/driver/config/provider.go @@ -37,18 +37,6 @@ const ( KeyDSN = "dsn" KeyBCryptCost = "oauth2.hashers.bcrypt.cost" KeyEncryptSessionData = "oauth2.session.encrypt_at_rest" - KeyAdminListenOnHost = "serve.admin.host" - KeyAdminListenOnPort = "serve.admin.port" - KeyAdminSocketOwner = "serve.admin.socket.owner" - KeyAdminSocketGroup = "serve.admin.socket.group" - KeyAdminSocketMode = "serve.admin.socket.mode" - KeyAdminDisableHealthAccessLog = "serve.admin.access_log.disable_for_health" - KeyPublicListenOnHost = "serve.public.host" - KeyPublicListenOnPort = "serve.public.port" - KeyPublicSocketOwner = "serve.public.socket.owner" - KeyPublicSocketGroup = "serve.public.socket.group" - KeyPublicSocketMode = "serve.public.socket.mode" - KeyPublicDisableHealthAccessLog = "serve.public.access_log.disable_for_health" KeyPublicAllowDynamicRegistration = "serve.public.allow_dynamic_registration" KeyCookieSameSiteMode = "serve.cookies.same_site_mode" KeyCookieSameSiteLegacyWorkaround = "serve.cookies.same_site_legacy_workaround" From dcad33b3ceefa59678a3780d2395e4acc699fce0 Mon Sep 17 00:00:00 2001 From: fjviera Date: Tue, 15 Jun 2021 08:09:54 +0200 Subject: [PATCH 04/41] Add dynamic client registration --- quickstart-postgres.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/quickstart-postgres.yml b/quickstart-postgres.yml index 734679525c7..0ea4dfd0f4b 100644 --- a/quickstart-postgres.yml +++ b/quickstart-postgres.yml @@ -14,6 +14,16 @@ version: '3.7' services: + hydra-migrate: + image: oryd/hydra:v1.10.2 + environment: + - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 + + hydra: + image: oryd/hydra:v1.10.2 + environment: + - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 + postgresd: image: postgres:9.6 ports: @@ -22,11 +32,5 @@ services: - POSTGRES_USER=hydra - POSTGRES_PASSWORD=secret - POSTGRES_DB=hydra - - hydra-migrate: - image: oryd/hydra:v1.9.2 - environment: - - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 - command: - migrate sql -e --yes - restart: on-failure + networks: + - intranet From 1c56455e600d9e2e5c8405b196d46091d0eb7d11 Mon Sep 17 00:00:00 2001 From: fjviera Date: Tue, 15 Jun 2021 08:28:06 +0200 Subject: [PATCH 05/41] Add dynamic client registration --- go.mod | 12 +-- go.sum | 253 +++++++++++++++++++-------------------------------------- 2 files changed, 87 insertions(+), 178 deletions(-) diff --git a/go.mod b/go.mod index 165d709b431..f53ec4d639f 100644 --- a/go.mod +++ b/go.mod @@ -8,16 +8,13 @@ replace github.com/ory/kratos/corp => github.com/ory/kratos/corp v0.0.0-20210118 replace github.com/ory/kratos-client-go => github.com/ory/kratos-client-go v0.5.4-alpha.1.0.20210210170256-960b093d8bf9 -replace github.com/seatgeek/logrus-gelf-formatter => github.com/zepatrik/logrus-gelf-formatter v0.0.0-20210305135027-b8b3731dba10 - replace github.com/dgrijalva/jwt-go => github.com/form3tech-oss/jwt-go v3.2.1+incompatible replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 require ( github.com/DataDog/datadog-go v4.6.0+incompatible // indirect - github.com/HdrHistogram/hdrhistogram-go v1.0.0 // indirect - github.com/Jeffail/gabs/v2 v2.6.1 // indirect + github.com/Jeffail/gabs/v2 v2.6.1 github.com/cenkalti/backoff/v3 v3.0.0 github.com/containerd/containerd v1.4.4 // indirect github.com/evanphx/json-patch v0.5.2 @@ -48,12 +45,12 @@ require ( github.com/oleiade/reflections v1.0.1 github.com/olekukonko/tablewriter v0.0.1 github.com/ory/analytics-go/v4 v4.0.1 - github.com/ory/cli v0.0.49 + github.com/ory/cli v0.0.35 github.com/ory/fosite v0.40.2 github.com/ory/go-acc v0.2.6 github.com/ory/graceful v0.1.1 - github.com/ory/herodot v0.9.3 - github.com/ory/x v0.0.242 + github.com/ory/herodot v0.9.6 + github.com/ory/x v0.0.253 github.com/pborman/uuid v1.2.1 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 github.com/philhofer/fwd v1.1.1 // indirect @@ -66,7 +63,6 @@ require ( github.com/sawadashota/encrypta v0.0.2 github.com/sirupsen/logrus v1.8.1 github.com/spf13/cobra v1.1.3 - github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518 // indirect github.com/stretchr/testify v1.7.0 github.com/tidwall/gjson v1.7.1 github.com/toqueteos/webbrowser v1.2.0 diff --git a/go.sum b/go.sum index edb02c04ed6..b2ef67cfcf0 100644 --- a/go.sum +++ b/go.sum @@ -36,33 +36,20 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v4.0.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.6.0+incompatible h1:t0Bg2oQPjzHChTlHKHBdAAB8CBVRySA+mcoSnzH3pLM= github.com/DataDog/datadog-go v4.6.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/HdrHistogram/hdrhistogram-go v1.0.1 h1:GX8GAYDuhlFQnI2fRDHQhTlkHMz8bEn0jTI6LJU0mpw= -github.com/HdrHistogram/hdrhistogram-go v1.0.1/go.mod h1:BWJ+nMSHY3L41Zj7CA3uXnloDp7xxV0YvstAE7nKTaM= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/HdrHistogram/hdrhistogram-go v1.0.0 h1:jivTvI9tBw5B8wW9Qd0uoQ2qaajb29y4TPhYTgh8Lb0= -github.com/HdrHistogram/hdrhistogram-go v1.0.0/go.mod h1:YzE1EgsuAz8q9lfGdlxBZo2Ma655+PfKp2mlzcAqIFw= github.com/Jeffail/gabs/v2 v2.6.1 h1:wwbE6nTQTwIMsMxzi6XFQQYRZ6wDc1mSdxoAN+9U4Gk= github.com/Jeffail/gabs/v2 v2.6.1/go.mod h1:xCn81vdHKxFUuWWAaD5jCTQDNPBMh5pPs9IJ+NcziBI= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver/v3 v3.0.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.0.0/go.mod h1:NEUY/Qq8Gdm2xgYA+NwJM6wmfdRV9xkh8h/Rld20R0U= -github.com/Masterminds/sprig/v3 v3.1.0 h1:j7GpgZ7PdFqNsmncycTHsLmVPf5/3wJtlgW9TNDYD9Y= -github.com/Masterminds/sprig/v3 v3.1.0/go.mod h1:ONGMf7UfYGAbMXCZmQLy8x3lCDIPrEZE/rU8pmrbihA= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -77,7 +64,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajg/form v0.0.0-20160822230020-523a5da1a92f h1:zvClvFQwU++UpIUBGC8YmDlfhUrweEy1R1Fj1gu5iIM= github.com/ajg/form v0.0.0-20160822230020-523a5da1a92f/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= @@ -90,8 +78,6 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -105,9 +91,8 @@ github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:o github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/avast/retry-go v2.6.0+incompatible h1:FelcMrm7Bxacr1/RM8+/eqkDkmVN7tjlsy51dOzB3LI= github.com/avast/retry-go v2.6.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= -github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= -github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.23.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -123,16 +108,14 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm github.com/bmatcuk/doublestar/v2 v2.0.3/go.mod h1:QMmcs3H2AUQICWhfzLXz+IYln8lRQmTZRptLie8RgRw= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bwmarrin/discordgo v0.23.0 h1://ARp8qUrRZvDGMkfAjtcC20WOvsMtTgi+KrdKnl6eY= -github.com/bwmarrin/discordgo v0.23.0/go.mod h1:c1WtWUGN6nREDmzIpyTp/iD3VYt4Fpx+bVyfBG7JE+M= -github.com/bxcodec/faker/v3 v3.3.1 h1:G7uldFk+iO/ES7W4v7JlI/WU9FQ6op9VJ15YZlDEhGQ= -github.com/bxcodec/faker/v3 v3.3.1/go.mod h1:gF31YgnMSMKgkvl+fyEo1xuSMbEuieyqfeslGYFjneM= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= +github.com/cenkalti/backoff/v4 v4.1.0 h1:c8LkOFQTzuO0WBM/ae5HdGQuZPfPxp7lqBRwQRm4fSc= +github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -155,6 +138,7 @@ github.com/cockroachdb/cockroach-go v0.0.0-20200312223839-f565e4789405/go.mod h1 github.com/cockroachdb/cockroach-go/v2 v2.1.1 h1:3XzfSMuUT0wBe1a3o5C0eOTcArhmmFAg2Jzh/7hhKqo= github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= @@ -168,7 +152,6 @@ github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkE github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk= github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -183,14 +166,14 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/godog v0.8.1 h1:lVb+X41I4YDreE+ibZ50bdXmySxgRviYFgKY6Aw4XE8= github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davidrjonas/semver-cli v0.0.0-20190116233701-ee19a9a0dda6/go.mod h1:+6FzxsSbK4oEuvdN06Jco8zKB2mQqIB6UduZdd0Zesk= github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/dgraph-io/ristretto v0.0.1/go.mod h1:T40EBc7CJke8TkpiYfGGKAeFjSaxuFXhuXRyumBd6RE= @@ -221,8 +204,6 @@ github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6 github.com/elastic/go-windows v1.0.0 h1:qLURgZFkkrYyTTkvYpsZIgf83AUsdIHfvlJaqaZ7aSY= github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= github.com/elazarl/goproxy v0.0.0-20181003060214-f58a169a71a5/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elnormous/contenttype v0.0.0-20210110050721-79150725153f h1:juwLa2Kbp2uwOGMOagrkTYXN/5+7sbINMmIZSluH2Gc= -github.com/elnormous/contenttype v0.0.0-20210110050721-79150725153f/go.mod h1:ngVcyGGU8pnn4QJ5sL4StrNgc/wmXZXy5IQSBuHOFPg= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -241,31 +222,25 @@ github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8S github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.1+incompatible h1:xdtqez379uWVJ9P3qQMX8W+F/nqsTdUvyMZB36tnacA= github.com/form3tech-oss/jwt-go v3.2.1+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/getkin/kin-openapi v0.48.0 h1:S0GfNAB2kgpB3f7Y1fCYJJV8i39KTZwswJxAjg7nT7Q= -github.com/getkin/kin-openapi v0.48.0/go.mod h1:ZJSfy1PxJv2QQvH9EdBj3nupRTVvV42mkW6zKUlRBwk= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-bindata/go-bindata v3.1.1+incompatible h1:tR4f0e4VTO7LK6B2YWyAoVEzG9ByG1wrXB4TL9+jiYg= github.com/go-bindata/go-bindata v3.1.1+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= -github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -318,7 +293,6 @@ github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= -github.com/go-openapi/runtime v0.19.23/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= github.com/go-openapi/runtime v0.19.26 h1:K/6PoVNj5WJXUnMk+VEbELeXjtBkCS1UxTDa04tdXE0= github.com/go-openapi/runtime v0.19.26/go.mod h1:BvrQtn6iVb2QmiVXRsFAm6ZCAZBpbVKFfN6QWCp582M= @@ -340,7 +314,6 @@ github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6 github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.8/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= @@ -350,7 +323,6 @@ github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY= github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= github.com/go-openapi/swag v0.19.13 h1:233UVgMy1DlmCYYfOiFpta6e2urloh+sEs5id6lyzog= github.com/go-openapi/swag v0.19.13/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= @@ -362,14 +334,6 @@ github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0 github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI= github.com/go-openapi/validate v0.20.1 h1:QGQ5CvK74E28t3DkegGweKR+auemUi5IdpMc4x3UW6s= github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= @@ -380,8 +344,7 @@ github.com/go-swagger/go-swagger v0.26.1 h1:1XUWLnH6hKxHzeKjJfA2gHkSqcT1Zgi4q/PZ github.com/go-swagger/go-swagger v0.26.1/go.mod h1:zlf/LHplZpdtU2mYXg9Ajd3+9TgHYltv5f/pEM6LjnI= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013 h1:l9rI6sNaZgNC0LnF3MiE+qTmyBA/tZAg1rtyrGbUMK0= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.mod h1:b65mBPzqzZWxOZGxSWrqs4GInLIn+u99Q9q7p+GKni0= -github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= -github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/attrs v0.1.0/go.mod h1:fmNpaWyHM0tRm8gCZWKx8yY9fvaNLo2PyzBNSrBZ5Hw= github.com/gobuffalo/buffalo v0.12.8-0.20181004233540-fac9bb505aa8/go.mod h1:sLyT7/dceRXJUxSsE813JTQtA3Eb1vjxWfo/N//vXIY= @@ -617,7 +580,6 @@ github.com/gobuffalo/pop v4.13.1+incompatible/go.mod h1:DwBz3SD5SsHpTZiTubcsFWcV github.com/gobuffalo/pop/v5 v5.0.11/go.mod h1:mZJHJbA3cy2V18abXYuVop2ldEJ8UZ2DK6qOekC5u5g= github.com/gobuffalo/pop/v5 v5.2.0/go.mod h1:Hj586Cr7FoTFNmvzyNdUcajv3r0A+W+bkil4RIX/zKo= github.com/gobuffalo/pop/v5 v5.3.1/go.mod h1:vcEDhh6cJ3WVENqJDFt/6z7zNb7lLnlN8vj3n5G9rYA= -github.com/gobuffalo/pop/v5 v5.3.2-0.20210128124218-e397a61c1704/go.mod h1:Ey1hqzDLkWQKNEfsnafaz+3P1h/TrS++W9PmpGsNxvk= github.com/gobuffalo/pop/v5 v5.3.3/go.mod h1:Ey1hqzDLkWQKNEfsnafaz+3P1h/TrS++W9PmpGsNxvk= github.com/gobuffalo/pop/v5 v5.3.4 h1:VWH74icA8khG8SyWDAq6Ch00jcPiC4n436JMFh0lLm0= github.com/gobuffalo/pop/v5 v5.3.4/go.mod h1:UiVurv2aTKC7MuR27PnMrQjAazoLr8SoC/LuTKTS/tQ= @@ -650,7 +612,6 @@ github.com/gobuffalo/tags/v3 v3.1.0 h1:mzdCYooN2VsLRr8KIAdEZ1lh1Py7JSMsiEGCGata2 github.com/gobuffalo/tags/v3 v3.1.0/go.mod h1:ZQeN6TCTiwAFnS0dNcbDtSgZDwNKSpqajvVtt6mlYpA= github.com/gobuffalo/uuid v2.0.3+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= github.com/gobuffalo/uuid v2.0.4+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= -github.com/gobuffalo/uuid v2.0.5+incompatible h1:c5uWRuEnYggYCrT9AJm0U2v1QTG7OVDAvxhj8tIV5Gc= github.com/gobuffalo/uuid v2.0.5+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= github.com/gobuffalo/validate v2.0.3+incompatible/go.mod h1:N+EtDe0J8252BgfzQUChBgfd6L93m9weay53EWFVsMM= github.com/gobuffalo/validate v2.0.4+incompatible h1:ZTxozrIw8qQ5nfhShmc4izjYPTsPhfdXTdhXOd5OS9o= @@ -674,7 +635,6 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/gddo v0.0.0-20180828051604-96d2a289f41e/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= -github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2 h1:xisWqjiKEff2B0KfFYGpCqc3M3zdTz+OHQHRc09FeYk= github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -705,10 +665,8 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1 h1:jAbXjIeW2ZSW2AwFxlGTDoc2CjI2XujLkV3ArsZFCvc= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomarkdown/markdown v0.0.0-20201113031856-722100d81a8e h1:/Y3B7hM9H3TOWPhe8eWGBGS4r09pjvS5Z0uoPADyjmU= @@ -726,12 +684,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v27 v27.0.1 h1:sSMFSShNn4VnqCqs+qhab6TS3uQc+uVR6TD1bW6MavM= -github.com/google/go-github/v27 v27.0.1/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0= -github.com/google/go-jsonnet v0.16.0 h1:Nb4EEOp+rdeGGyB1rQ5eisgSAqrTnhf9ip+X6lzZbY0= github.com/google/go-jsonnet v0.16.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-jsonnet v0.17.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -747,7 +701,6 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -784,56 +737,57 @@ github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69 h1:7xsUJsB2Nrdct github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69/go.mod h1:YLEMZOtU+AZ7dhN9T/IpGhXVGly2bvkJQ+zxj3WeVQo= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/api v1.5.0/go.mod h1:LqwrLNW876eYSuUOo4ZLHBcdKc038txr/IMfbLPATa4= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.5.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.8 h1:92lWxgpa+fF3FozM4B3UZtHZMJX8T5XT+TFdCxsPyWs= github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.2.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.9.0/go.mod h1:YL0HO+FifKOW2u1ke99DGVu1zhcpZzNwrLIqBC7vbYU= +github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= +github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= -github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/inhies/go-bytesize v0.0.0-20201103132853-d0aed0d254f8 h1:RrGCja4Grfz7QM2hw+SUZIYlbHoqBfbvzlWRT3seXB8= github.com/inhies/go-bytesize v0.0.0-20201103132853-d0aed0d254f8/go.mod h1:KrtyD5PFj++GKkFS/7/RRrfnRhAMGQwy75GLCHWrCNs= +github.com/instana/go-sensor v1.29.0 h1:WoLxTJNjcPDfOYU4E+JCBqdQNcCpyQ2lJ2bYd5izND0= +github.com/instana/go-sensor v1.29.0/go.mod h1:Uh9j3eF2mBw/FLk2MxISmVDIj8mtJBFRj2S19M6CVyQ= +github.com/instana/testify v1.6.2-0.20200721153833-94b1851f4d65 h1:T25FL3WEzgmKB0m6XCJNZ65nw09/QIp3T1yXr487D+A= +github.com/instana/testify v1.6.2-0.20200721153833-94b1851f4d65/go.mod h1:nYhEREG/B7HUY7P+LKOrqy53TpIqmJ9JyUShcaEKtGw= github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -900,7 +854,7 @@ github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dv github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jandelgado/gcov2lcov v1.0.4-0.20210120124023-b83752c6dc08/go.mod h1:NnSxK6TMlg1oGDBfGelGbjgorT5/L3cchlbtgFYZSss= -github.com/jandelgado/gcov2lcov v1.0.4 h1:ADwQPyNsxguqzznIbfQTENwY9FU88JdXEvpdHR9c48A= +github.com/jandelgado/gcov2lcov v1.0.4 h1:54+QJDjOQcRMLsC6aFXeYKQ+GEhN2DaYfKEtjDWnOrM= github.com/jandelgado/gcov2lcov v1.0.4/go.mod h1:NnSxK6TMlg1oGDBfGelGbjgorT5/L3cchlbtgFYZSss= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -926,11 +880,9 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jteeuwen/go-bindata v3.0.7+incompatible/go.mod h1:JVvhzYOiGBnFSYRyV00iY8q7/0PThjIYav1p9h5dmKs= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -955,8 +907,9 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL 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.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/knadh/koanf v0.14.1-0.20201201075439-e0853799f9ec h1:fmu57yNGunS2xD2VDDAz6+6F2Qn9/9M7KOhjsOqeFGM= github.com/knadh/koanf v0.14.1-0.20201201075439-e0853799f9ec/go.mod h1:H5mEFsTeWizwFXHKtsITL5ipsLTuAMQoGuQpp+1JL9U= +github.com/knadh/koanf v1.0.0 h1:tGQ1L53Tp4uPx6agVGBN1U7A4f83ZpH3SwZNG+BkfqI= +github.com/knadh/koanf v1.0.0/go.mod h1:vrMMuhIH0k7EoxiMbVfFlRvJYmxcT2Eha3DH8Tx5+X4= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 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.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -974,9 +927,6 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -987,6 +937,8 @@ github.com/lib/pq v1.10.1 h1:6VXZrLU0jHBYyAqrSPa+MgPfnSvTPuMgK+k0o5kVFWo= github.com/lib/pq v1.10.1/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/looplab/fsm v0.1.0 h1:Qte7Zdn/5hBNbXzP7yxVU4OIFHWXBovyTT2LaBTyC20= +github.com/looplab/fsm v0.1.0/go.mod h1:m2VaOfDHxqXBBMgc26m6yUOwkFn8H2AlJDE+jd/uafI= github.com/luna-duclos/instrumentedsql v0.0.0-20181127104832-b7d587d28109/go.mod h1:PWUIzhtavmOR965zfawVsHXbEuU1G29BPZ/CB3C7jXk= github.com/luna-duclos/instrumentedsql v1.1.2/go.mod h1:4LGbEqDnopzNAiyxPPDXhLspyunZxgPTMJBKtC6U0BQ= github.com/luna-duclos/instrumentedsql v1.1.3 h1:t7mvC0z1jUt5A0UQ6I/0H31ryymuQRnJcWCiqV3lSAA= @@ -1045,7 +997,6 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -1055,24 +1006,23 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/mattn/goveralls v0.0.5/go.mod h1:Xg2LHi51faXLyKXwsndxiW6uxEEQT9+3sjGzzwU4xy0= +github.com/mattn/goveralls v0.0.6 h1:cr8Y0VMo/MnEZBjxNN/vh6G90SZ7IMb6lms1dzMoO+Y= github.com/mattn/goveralls v0.0.6/go.mod h1:h8b4ow6FxSPMQHF6o2ve3qsclnffZjYTNEKmLesRwqw= -github.com/mattn/goveralls v0.0.7 h1:vzy0i4a2iDzEFMdXIxcanRadkr0FBvSBKUmj0P8SPlQ= -github.com/mattn/goveralls v0.0.7/go.mod h1:h8b4ow6FxSPMQHF6o2ve3qsclnffZjYTNEKmLesRwqw= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/microcosm-cc/bluemonday v1.0.2 h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/mikefarah/yq v1.15.0/go.mod h1:Klb/IuhiBF3HOsJXH3YR+xURVe3KFmm0jxwiklmdjP4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -1084,10 +1034,12 @@ github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2 h1:SPoLlS9qUUnXcIY4pvA4CTwYjk0Is5f4UPEkeESr53k= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -1158,21 +1110,18 @@ github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/ory/analytics-go/v4 v4.0.0/go.mod h1:FMx9cLRD9xN+XevPvZ5FDMfignpmcqPP6FUKnJ9/MmE= github.com/ory/analytics-go/v4 v4.0.1 h1:kKB2Mk8W0N23ZQCBHZ4wB6NQB6RxlxqzZB9LmSQ3Mho= github.com/ory/analytics-go/v4 v4.0.1/go.mod h1:FMx9cLRD9xN+XevPvZ5FDMfignpmcqPP6FUKnJ9/MmE= +github.com/ory/cli v0.0.35 h1:aAmkVq1lOlfdB/LKexFelIkajVe3RwC/IHEyFUAxbPw= github.com/ory/cli v0.0.35/go.mod h1:8iyLto6q8TiVgxbm4/D64Mt+Tavk1k18g786ZDM298Q= -github.com/ory/cli v0.0.41/go.mod h1:l5KYqpqmTB81BF+SlHwgH56Fp5IY+TMIdFKTPDkPolw= -github.com/ory/cli v0.0.49 h1:VFmctThbFr3GR9tZAQkX+C2wz8gMTi6f287cLxfMDQ4= -github.com/ory/cli v0.0.49/go.mod h1:IH1juqUjTWCVFM3PzINym92O0AACtSqQ6p/jgqaxvec= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.5.4/go.mod h1:J8ZUbNB2FOhm1cFZW9xBpDsODqsSWcyYgtJYVPcnF70= -github.com/ory/dockertest/v3 v3.6.2/go.mod h1:EFLcVUOl8qCwp9NyDAcCDtq/QviLtYswW/VbWzUnTNE= -github.com/ory/dockertest/v3 v3.6.3 h1:L8JWiGgR+fnj90AEOkTFIEp4j5uWAK72P3IUsYgn2cs= github.com/ory/dockertest/v3 v3.6.3/go.mod h1:EFLcVUOl8qCwp9NyDAcCDtq/QviLtYswW/VbWzUnTNE= +github.com/ory/dockertest/v3 v3.6.5 h1:mhNKFeVEHuvaYW+/u+59mLzM/6XXGjpaet/yApgv+yc= +github.com/ory/dockertest/v3 v3.6.5/go.mod h1:iYKQSRlYrt/2s5fJWYdB98kCQG6g/LjBMvzEYii63vg= github.com/ory/fosite v0.29.0/go.mod h1:0atSZmXO7CAcs6NPMI/Qtot8tmZYj04Nddoold4S2h0= github.com/ory/fosite v0.40.2 h1:xOS/1kPOlk1LqnAEnNXUqNGdMwvHBqw20ZbURaK+qoM= github.com/ory/fosite v0.40.2/go.mod h1:KbDZzqSDLaOLDN2haRIsBQHUhl8MQp66cYMqCpO/8Mg= github.com/ory/go-acc v0.0.0-20181118080137-ddc355013f90/go.mod h1:sxnvPCxChFuSmTJGj8FdMupeq1BezCiEpDjTUXQ4hf4= -github.com/ory/go-acc v0.1.0/go.mod h1:0omgy2aa3nDBJ45VAKeLHH8ccPBudxLeic4xiDRtug0= github.com/ory/go-acc v0.2.6 h1:YfI+L9dxI7QCtWn2RbawqO0vXhiThdXu/RgizJBbaq0= github.com/ory/go-acc v0.2.6/go.mod h1:4Kb/UnPcT8qRAk3IAxta+hvVapdxTLWtrr7bFLlEgpw= github.com/ory/go-convenience v0.1.0 h1:zouLKfF2GoSGnJwGq+PE/nJAE6dj2Zj5QlTgmMTsTS8= @@ -1186,48 +1135,29 @@ github.com/ory/graceful v0.1.1/go.mod h1:zqu70l95WrKHF4AZ6tXHvAqAvpY6M7g6ttaAVcM github.com/ory/herodot v0.6.2/go.mod h1:3BOneqcyBsVybCPAJoi92KN2BpJHcmDqAMcAAaJiJow= github.com/ory/herodot v0.7.0/go.mod h1:YXKOfAXYdQojDP5sD8m0ajowq3+QXNdtxA+QiUXBwn0= github.com/ory/herodot v0.8.3/go.mod h1:rvLjxOAlU5omtmgjCfazQX2N82EpMfl3BytBWc1jjsk= -github.com/ory/herodot v0.9.0/go.mod h1:GYF7mp8/WFRYDYJBR989lipjgx3NTjjdVdUC+hpB8mc= github.com/ory/herodot v0.9.2/go.mod h1:Da2HXR8mpwPbPrH+Gv9qV8mM5gI3v+PoJ69BA4l2RAk= -github.com/ory/herodot v0.9.3 h1:vfhidpS1fafk8FzQh7lEhImkp72UUU7x0G3gM1Un5CE= -github.com/ory/herodot v0.9.3/go.mod h1:g3yAI/d6wPdGnOt3dbYUj5JGTZBNuUVLuuDqHnfc1lM= +github.com/ory/herodot v0.9.6 h1:S2VSmlWgyhyogB4gH3659B3+1Pv9lJCv2a1uxigw1eg= +github.com/ory/herodot v0.9.6/go.mod h1:g3yAI/d6wPdGnOt3dbYUj5JGTZBNuUVLuuDqHnfc1lM= github.com/ory/jsonschema/v3 v3.0.1/go.mod h1:jgLHekkFk0uiGdEWGleC+tOm6JSSP8cbf17PnBuGXlw= -github.com/ory/jsonschema/v3 v3.0.2/go.mod h1:BPH8eu7Ws2kxeu4NRA0Pqrm15+fOJDPfQxb55v2sRXA= github.com/ory/jsonschema/v3 v3.0.3 h1:Y7KT4n84ROq8pJ3IMf9JDAulXqYKSU5xUtHjdQFbCLI= github.com/ory/jsonschema/v3 v3.0.3/go.mod h1:JvXwbx7IxAkIAo7Qo5OSC1lea+w12DtYGV8h+MTAfnA= -github.com/ory/kratos v0.5.5-alpha.1.0.20210210153145-e5a863030890/go.mod h1:TRBoejm9kt5Wvxf4uxa78FTZPmWenAGuN/BgYK5TkFI= -github.com/ory/kratos v0.5.5-alpha.1.0.20210319103511-3726ed4d145a h1:reMklzrmz6ash2RWzKqyGsPmuOPQA5todr+hohUw/bI= -github.com/ory/kratos v0.5.5-alpha.1.0.20210319103511-3726ed4d145a/go.mod h1:VdWQqc4JnfYWgAmI68rqlQqJfwKkgafRTPPm9nNnwEY= -github.com/ory/kratos-client-go v0.5.4-alpha.1.0.20210210170256-960b093d8bf9 h1:oaUuTD15+z4wv8/znC/My+YwkSHEQ/r2WrByahMcrs0= -github.com/ory/kratos-client-go v0.5.4-alpha.1.0.20210210170256-960b093d8bf9/go.mod h1:ADRXFi+QG6oLIXmYCRVoxJvuFA/hms9I2GdZyU0Nf4o= -github.com/ory/kratos/corp v0.0.0-20210118092700-c2358be1e867 h1:tlcdm9SxN/5v8AoYIR7NkNfOB/usX/8ZBMiKUaqnlX8= -github.com/ory/kratos/corp v0.0.0-20210118092700-c2358be1e867/go.mod h1:gHhPy2ShxFnqTw3SUWU5KRDf4+F54GgbldVsf6KE4R4= -github.com/ory/mail v2.3.1+incompatible h1:vHntHDHtQXamt2T+iwTTlCoBkDvILUeujE9Ocwe9md4= -github.com/ory/mail v2.3.1+incompatible/go.mod h1:87D9/1gB6ewElQoN0lXJ0ayfqcj3cW3qCTXh+5E9mfU= -github.com/ory/mail/v3 v3.0.0 h1:8LFMRj473vGahFD/ntiotWEd4S80FKYFtiZTDfOQ+sM= -github.com/ory/mail/v3 v3.0.0/go.mod h1:JGAVeZF8YAlxbaFDUHqRZAKBCSeW2w1vuxf28hFbZAw= -github.com/ory/nosurf v1.2.4 h1:UirSCPSu4nxMmcbI89G+ehZkr2QRrtdjPacia5egktI= -github.com/ory/nosurf v1.2.4/go.mod h1:d4L3ZBa7Amv55bqxCBtCs63wSlyaiCkWVl4vKf3OUxA= github.com/ory/viper v1.5.6/go.mod h1:TYmpFpKLxjQwvT4f0QPpkOn4sDXU1kDgAwJpgLYiQ28= github.com/ory/viper v1.7.4/go.mod h1:T6sodNZKNGPpashUOk7EtXz2isovz8oCd57GNVkkNmE= github.com/ory/viper v1.7.5 h1:+xVdq7SU3e1vNaCsk/ixsfxE4zylk1TJUiJrY647jUE= github.com/ory/viper v1.7.5/go.mod h1:ypOuyJmEUb3oENywQZRgeAMwqgOyDqwboO1tj3DjTaM= github.com/ory/x v0.0.84/go.mod h1:RXLPBG7B+hAViONVg0sHwK+U/ie1Y/NeXrq1JcARfoE= -github.com/ory/x v0.0.85/go.mod h1:s44V8t3xyjWZREcU+mWlp4h302rTuM4aLXcW+y5FbQ8= github.com/ory/x v0.0.93/go.mod h1:lfcTaGXpTZs7IEQAW00r9EtTCOxD//SiP5uWtNiz31g= github.com/ory/x v0.0.110/go.mod h1:DJfkE3GdakhshNhw4zlKoRaL/ozg/lcTahA9OCih2BE= github.com/ory/x v0.0.127/go.mod h1:FwUujfFuCj5d+xgLn4fGMYPnzriR5bdAIulFXMtnK0M= github.com/ory/x v0.0.166/go.mod h1:gT/3K0mSFaPllJgoFrvKYIBYI5W1Nz5RxQTJCGrIwDY= -github.com/ory/x v0.0.179/go.mod h1:SGETCUk1DgQC30bb7y4hjhkKGQ1x0YOsldrmGmy6MNc= -github.com/ory/x v0.0.181/go.mod h1:SGETCUk1DgQC30bb7y4hjhkKGQ1x0YOsldrmGmy6MNc= -github.com/ory/x v0.0.189/go.mod h1:uJK3Re/AF6F3LCNnwqzeU/ftmexCpjqwfdyrDc6PbcM= github.com/ory/x v0.0.205/go.mod h1:A1s4iwmFIppRXZLF3J9GGWeY/HpREVm0Dk5z/787iek= -github.com/ory/x v0.0.207/go.mod h1:sBgvUAcmc2lmtOBe5VMcV2vNAlADT4bkFHomG29y7N4= github.com/ory/x v0.0.212/go.mod h1:RDxYOolvMdzumYnHWha8D+RoLjYtGszyDDed4OCGC54= -github.com/ory/x v0.0.242 h1:WVpdpA7SOh9RPFjLgvBp0Xu1unAnnUPOCO7f0mZLyzw= -github.com/ory/x v0.0.242/go.mod h1:KPgNsUzpztH15EZdw5HjurtTe+mXQ34yqMCCTb5BZAc= +github.com/ory/x v0.0.253 h1:xnLHszVEtnLqhJdxY84sT2L5g0PoLfHvVChfIq3Dj2s= +github.com/ory/x v0.0.253/go.mod h1:mntqi++7C8YOdf/sNHPb6MJ3D9klSrDyZSspIHvxiYw= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= @@ -1258,14 +1188,12 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20200921180117-858c6e7e6b7e h1:BLqxdwZ6j771IpSCRx7s/GJjXHUE00Hmu7/YegCGdzA= github.com/pquerna/cachecontrol v0.0.0-20200921180117-858c6e7e6b7e/go.mod h1:hoLfEwdY11HjRfKFH6KqnPsfxlo3BP6bJehpDv8t6sQ= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= @@ -1281,7 +1209,6 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= @@ -1299,6 +1226,7 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rhnvrm/simples3 v0.5.0/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= +github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.0.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1321,6 +1249,8 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/santhosh-tekuri/jsonschema v1.2.4 h1:hNhW8e7t+H1vgY+1QeEQpveR6D4+OwKPXCfD2aieJis= github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= @@ -1329,6 +1259,9 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh github.com/sawadashota/encrypta v0.0.2 h1:R46/RxYmYdxI3VOt63B637OVBHzu+fazPyLo5CqK6QE= github.com/sawadashota/encrypta v0.0.2/go.mod h1:pcPebEvF012kXmZXvfVzwFEr/GUE/ZntaR805jk0nsE= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/seatgeek/logrus-gelf-formatter v0.0.0-20210219220335-367fa274be2c/go.mod h1:/THDZYi7F/BsVEcYzYPqdcWFQ+1C2InkawTKfLOAnzg= +github.com/seatgeek/logrus-gelf-formatter v0.0.0-20210414080842-5b05eb8ff761 h1:0b8DF5kR0PhRoRXDiEEdzrgBc8UqVY4JWLkQJCRsLME= +github.com/seatgeek/logrus-gelf-formatter v0.0.0-20210414080842-5b05eb8ff761/go.mod h1:/THDZYi7F/BsVEcYzYPqdcWFQ+1C2InkawTKfLOAnzg= github.com/segmentio/analytics-go v3.0.1+incompatible/go.mod h1:C7CYBtQWk4vRk2RyLu0qOcbHJ18E3F1HV2C/8JvKN48= github.com/segmentio/analytics-go v3.1.0+incompatible/go.mod h1:C7CYBtQWk4vRk2RyLu0qOcbHJ18E3F1HV2C/8JvKN48= github.com/segmentio/backo-go v0.0.0-20160424052352-204274ad699c/go.mod h1:kJ9mm9YmoWSkk+oQ+5Cj8DEoRCX2JT6As4kEtIIOp1M= @@ -1345,7 +1278,6 @@ github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9Nz github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= @@ -1367,10 +1299,6 @@ github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/slack-go/slack v0.7.4 h1:Z+7CmUDV+ym4lYLA4NNLFIpr3+nDgViHrx8xsuXgrYs= -github.com/slack-go/slack v0.7.4/go.mod h1:FGqNzJBmxIsZURAxh2a8D21AnOVvvXZvGligs4npPUM= -github.com/smallstep/truststore v0.9.6 h1:vNzEJmaJL0XOZD8uouXLmYu4/aP1UQ/wHUopH3qKeYA= -github.com/smallstep/truststore v0.9.6/go.mod h1:HwHKRcBi0RUxxw1LYDpTRhYC4jZUuxPpkHdVonlkoDM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= @@ -1382,9 +1310,8 @@ github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d h1:yKm7XZV6j9 github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e h1:qpG93cPwA5f7s/ZPBJnGOYQNK/vKsaDaseuKT5Asee8= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.0/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -1423,7 +1350,6 @@ github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518 h1:iD+PFTQwKEmbwSdwfvP5ld2WEI/g7qbdhmHJ2ASfYGs= github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518/go.mod h1:CKI4AZ4XmGV240rTHfO0hfE83S6/a3/Q1siZJ/vXf7A= -github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693 h1:wD1IWQwAhdWclCwaf6DdzgCAe9Bfz1M+4AHRd7N786Y= github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693/go.mod h1:6hSY48PjDm4UObWmGLyJE9DxYVKTgR9kbCspXXJEhcU= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1443,8 +1369,6 @@ github.com/subosito/gotenv v1.1.1/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69 github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tidwall/gjson v1.3.2/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= -github.com/tidwall/gjson v1.3.5/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= -github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/gjson v1.6.8/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/gjson v1.7.1 h1:hwkZ6V1/EF8FxNhKJrIXQwSscyl2yWCZ1SkOCQYHSHA= github.com/tidwall/gjson v1.7.1/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk= @@ -1456,7 +1380,6 @@ github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8= github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/sjson v1.0.4/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y= -github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= github.com/tidwall/sjson v1.1.5 h1:wsUceI/XDyZk3J1FUvuuYlK62zJv2HO2Pzb8A5EWdUE= github.com/tidwall/sjson v1.1.5/go.mod h1:VuJzsZnTowhSxWdOgsAnb886i4AjEyTkk7tNtsL7EYE= github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= @@ -1470,9 +1393,8 @@ github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMW github.com/uber/jaeger-client-go v2.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM= github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v1.5.0/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= +github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw= github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/uber/jaeger-lib v2.4.0+incompatible h1:fY7QsGQWiCt8pajv4r7JEvmATdCVaWxXbjwyYwsNaLQ= -github.com/uber/jaeger-lib v2.4.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/unrolled/secure v0.0.0-20180918153822-f340ee86eb8b/go.mod h1:mnPT77IAdsi/kV7+Es7y+pXALeV3h7G6dQF6mNYjcLA= @@ -1494,8 +1416,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -github.com/zepatrik/logrus-gelf-formatter v0.0.0-20210305135027-b8b3731dba10 h1:LEDqWCSheba8QLCISBZ2JDYHNN4kl6DNwTIpebE9bEQ= -github.com/zepatrik/logrus-gelf-formatter v0.0.0-20210305135027-b8b3731dba10/go.mod h1:g03kJ+ioXqOLNEIRHCsX1OoCnINQpWp0sYD61zovSbA= github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.elastic.co/apm v1.8.0 h1:AWEKpHwRal0yCMd4K8Oxy1HAa7xid+xq1yy+XjgoVU0= @@ -1513,10 +1433,9 @@ go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.5 h1:TLtO+iD8krabXxvY1F1qpBOHgOxhLWR7XsT7kQeRmMY= +go.mongodb.org/mongo-driver v1.4.5 h1:z4/YQzLTxI+ymcrS//Wc2JBn2b9ojvpVH3BaYT8rqUc= go.mongodb.org/mongo-driver v1.4.5/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1526,20 +1445,26 @@ go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/contrib v0.18.0 h1:uqBh0brileIvG6luvBjdxzoFL8lxDGuhxJWsvK3BveI= go.opentelemetry.io/contrib v0.18.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= +go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= +go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.13.0/go.mod h1:TwTkyRaTam1pOIb2wxcAiC2hkMVbokXkt6DEt5nDkD8= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.18.0 h1:Qc7uU8GzpQ0Gak2oOmEcpiL9uRaVhatxkE1EzNhJW00= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.18.0/go.mod h1:iK1G0FgHurSJ/aYLg5LpnPI0pqdanM73S3dhyDp0Lk4= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.20.0 h1:ZvMGSC/Uo38s6CIYePWMFnAshVt6vvM0I0fRPXRFnLQ= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.20.0/go.mod h1:OFd9uK8rOqNvUtgeLz7/5MeIRDZPPbjnVdN4jK80j10= go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel v0.18.0 h1:d5Of7+Zw4ANFOJB+TIn2K3QWsgS2Ht7OU9DqZHI6qu8= go.opentelemetry.io/otel v0.18.0/go.mod h1:PT5zQj4lTsR1YeARt8YNKcFb88/c2IKoSABK9mX0r78= -go.opentelemetry.io/otel/metric v0.18.0 h1:yuZCmY9e1ZTaMlZXLrrbAPmYW6tW1A5ozOZeOYGaTaY= +go.opentelemetry.io/otel v0.20.0 h1:eaP0Fqu7SXHwvjiqDq83zImeehOHX8doTvU9AwXON8g= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= go.opentelemetry.io/otel/metric v0.18.0/go.mod h1:kEH2QtzAyBy3xDVQfGZKIcok4ZZFvd5xyKPfPcuK6pE= -go.opentelemetry.io/otel/oteltest v0.18.0 h1:FbKDFm/LnQDOHuGjED+fy3s5YMVg0z019GJ9Er66hYo= +go.opentelemetry.io/otel/metric v0.20.0 h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/oteltest v0.18.0/go.mod h1:NyierCU3/G8DLTva7KRzGii2fdxdR89zXKH1bNWY7Bo= -go.opentelemetry.io/otel/trace v0.18.0 h1:ilCfc/fptVKaDMK1vWk0elxpolurJbEgey9J6g6s+wk= +go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXSJN57AXIt/iDk= +go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1567,7 +1492,6 @@ golang.org/x/crypto v0.0.0-20181024171144-74cb1d3d52f4/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181025113841-85e1b3f9139a/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181127143415-eb0de9b17e85/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1588,13 +1512,11 @@ golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200320181102-891825fb96df/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1673,7 +1595,6 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1696,9 +1617,8 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4 h1:b0LrWgu8+q7z4J+0Y3Umo5q1dL7NXBkKBWkaVkAq17E= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181003184128-c57b0facaced/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1743,6 +1663,7 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190102155601-82a175fd1598/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190116161447-11f53e031339/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1761,11 +1682,8 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191105231009-c1f44814a5cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1798,16 +1716,15 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210319071255-635bc2c9138d h1:jbzgAvDZn8aEnytae+4ou0J0GwFZoHR0hOrTg4qH8GA= -golang.org/x/sys v0.0.0-20210319071255-635bc2c9138d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -1872,7 +1789,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190711191110-9a621aea19f8/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1888,7 +1804,6 @@ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20191224055732-dd894d0a8a40/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200113040837-eac381796e91/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1957,6 +1872,7 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1987,9 +1903,9 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210318145829-90b20ab00860 h1:/u8n534a0fs4pq+41+yGfyD5HoUFPhaeVB9wb6xvNJQ= -google.golang.org/genproto v0.0.0-20210318145829-90b20ab00860/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -2021,17 +1937,15 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/DataDog/dd-trace-go.v1 v1.27.0/go.mod h1:Sp1lku8WJMvNV0kjDI4Ni/T7J/U3BO5ct5kEaoVU8+I= gopkg.in/DataDog/dd-trace-go.v1 v1.27.1 h1:9BJfwtuCUrUiNB3WCTXHuaP5E/J/zfMPUUaRJoEQfdc= gopkg.in/DataDog/dd-trace-go.v1 v1.27.1/go.mod h1:Sp1lku8WJMvNV0kjDI4Ni/T7J/U3BO5ct5kEaoVU8+I= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= +gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2044,7 +1958,6 @@ gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/mold.v2 v2.2.0/go.mod h1:XMyyRsGtakkDPbxXbrA5VODo6bUXyvoDjLd5l3T0XoA= -gopkg.in/go-playground/validator.v9 v9.28.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= gopkg.in/gorp.v1 v1.7.2 h1:j3DWlAyGVv8whO7AcIWznQ2Yj7yJkn34B8s63GViAAw= gopkg.in/gorp.v1 v1.7.2/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= @@ -2055,10 +1968,10 @@ gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mail.v2 v2.0.0-20180731213649-a0242b2233b4/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= -gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.1.9/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= From 8722e2a7576ff39d5d1cf92c579474cbcab0e9ee Mon Sep 17 00:00:00 2001 From: fjviera Date: Tue, 15 Jun 2021 09:15:59 +0200 Subject: [PATCH 06/41] Add dynamic client registration --- driver/config/provider_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/config/provider_test.go b/driver/config/provider_test.go index b8f8a365d63..d0bcd962616 100644 --- a/driver/config/provider_test.go +++ b/driver/config/provider_test.go @@ -306,7 +306,7 @@ func TestViperProviderValidates(t *testing.T) { assert.Equal(t, true, c.EnforcePKCEForPublicClients()) // secrets - assert.Equal(t, []byte{0x64, 0x40, 0x5f, 0xd4, 0x66, 0xc9, 0x8c, 0x88, 0xa7, 0xf2, 0xcb, 0x95, 0xcd, 0x95, 0xcb, 0xa3, 0x41, 0x49, 0x8b, 0x97, 0xba, 0x9e, 0x92, 0xee, 0x4c, 0xaf, 0xe0, 0x71, 0x23, 0x28, 0xeb, 0xfc}, c.GetSystemSecret()) + assert.Equal(t, []byte{0x49, 0x82, 0xdd, 0xb8, 0x8d, 0x6c, 0xdb, 0xe9, 0x43, 0xe0, 0x0, 0xb6, 0xeb, 0x22, 0x62, 0xdc, 0xe3, 0x9d, 0xf3, 0xba, 0xdd, 0x2e, 0x23, 0x2b, 0xb5, 0xdc, 0xca, 0x42, 0x75, 0xad, 0x83, 0x13}, c.GetSystemSecret()) assert.Equal(t, [][]uint8{[]byte("some-random-cookie-secret")}, c.GetCookieSecrets()) // profiling From e5b9dedef88261953033f3c2ca1113d19c451576 Mon Sep 17 00:00:00 2001 From: fjviera Date: Tue, 15 Jun 2021 09:45:46 +0200 Subject: [PATCH 07/41] Add dynamic client registration --- .../openid/dynamic_client_registration.js | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/cypress/integration/openid/dynamic_client_registration.js b/cypress/integration/openid/dynamic_client_registration.js index 97b6538b087..2ea1f4bcc1e 100644 --- a/cypress/integration/openid/dynamic_client_registration.js +++ b/cypress/integration/openid/dynamic_client_registration.js @@ -1,9 +1,7 @@ import { prng } from '../../helpers' describe('The Clients Pubic Interface', function () { - it('should return same client_secret given in request for newly created clients with client_secret specified', function () { - cy.request({ method: 'POST', url: Cypress.env('public_url') + '/clients', @@ -12,9 +10,7 @@ describe('The Clients Pubic Interface', function () { client_name: 'clientName', client_secret: 'secret', scope: 'foo openid offline_access', - grant_types: [ - 'client_credentials' - ] + grant_types: ['client_credentials'] } }).then((response) => { console.log(response.body) @@ -23,7 +19,6 @@ describe('The Clients Pubic Interface', function () { }) it('should get client when having a valid client_secret in body', function () { - cy.request({ method: 'GET', url: Cypress.env('public_url') + '/clients/clientid?secret=secret' @@ -34,18 +29,16 @@ describe('The Clients Pubic Interface', function () { }) it('should fail for get client when having an invalid client_secret in body', function () { - cy.request({ method: 'GET', failOnStatusCode: false, url: Cypress.env('public_url') + '/clients/clientid?secret=wrongsecret' }).then((response) => { - expect(response.status).to.eq(401); + expect(response.status).to.eq(401) }) }) it('should update client name when having a valid client_secret in body', function () { - cy.request({ method: 'PUT', url: Cypress.env('public_url') + '/clients/clientid', @@ -54,9 +47,7 @@ describe('The Clients Pubic Interface', function () { client_name: 'clientName2', client_secret: 'secret', scope: 'foo openid offline_access', - grant_types: [ - 'client_credentials' - ] + grant_types: ['client_credentials'] } }).then((response) => { console.log(response.body) @@ -65,7 +56,6 @@ describe('The Clients Pubic Interface', function () { }) it('should fail to update client name when having an invalid client_secret in body', function () { - cy.request({ method: 'PUT', failOnStatusCode: false, @@ -75,36 +65,30 @@ describe('The Clients Pubic Interface', function () { client_name: 'clientName2', client_secret: 'wrongsecret', scope: 'foo openid offline_access', - grant_types: [ - 'client_credentials' - ] + grant_types: ['client_credentials'] } }).then((response) => { - expect(response.status).to.eq(401); + expect(response.status).to.eq(401) }) }) it('should fail to delete client when having an invalid client_secret as parameter body', function () { - cy.request({ method: 'DELETE', failOnStatusCode: false, url: Cypress.env('public_url') + '/clients/clientid?secret=wrongsecret' }).then((response) => { - expect(response.status).to.eq(401); + expect(response.status).to.eq(401) }) }) it('should delete client when having an valid client_secret as parameter body', function () { - cy.request({ method: 'DELETE', failOnStatusCode: false, url: Cypress.env('public_url') + '/clients/clientid?secret=secret' }).then((response) => { - expect(response.status).to.eq(204); + expect(response.status).to.eq(204) }) }) - - }) From db7dc63a0cdd9662ef8bc45db99ba32d90765cbd Mon Sep 17 00:00:00 2001 From: fjviera Date: Tue, 15 Jun 2021 09:51:34 +0200 Subject: [PATCH 08/41] Add dynamic client registration --- go.sum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.sum b/go.sum index b2ef67cfcf0..d999b8dc3a5 100644 --- a/go.sum +++ b/go.sum @@ -854,7 +854,7 @@ github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dv github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jandelgado/gcov2lcov v1.0.4-0.20210120124023-b83752c6dc08/go.mod h1:NnSxK6TMlg1oGDBfGelGbjgorT5/L3cchlbtgFYZSss= -github.com/jandelgado/gcov2lcov v1.0.4 h1:54+QJDjOQcRMLsC6aFXeYKQ+GEhN2DaYfKEtjDWnOrM= +github.com/jandelgado/gcov2lcov v1.0.4 h1:ADwQPyNsxguqzznIbfQTENwY9FU88JdXEvpdHR9c48A= github.com/jandelgado/gcov2lcov v1.0.4/go.mod h1:NnSxK6TMlg1oGDBfGelGbjgorT5/L3cchlbtgFYZSss= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= From dd9ec52748cea89adf7fefa133c6c6207d1a2595 Mon Sep 17 00:00:00 2001 From: fjviera Date: Tue, 15 Jun 2021 09:55:17 +0200 Subject: [PATCH 09/41] Add dynamic client registration --- go.sum | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go.sum b/go.sum index d999b8dc3a5..dae6ab337da 100644 --- a/go.sum +++ b/go.sum @@ -1433,9 +1433,10 @@ go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.mongodb.org/mongo-driver v1.4.4/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.4.5 h1:z4/YQzLTxI+ymcrS//Wc2JBn2b9ojvpVH3BaYT8rqUc= +go.mongodb.org/mongo-driver v1.4.5 h1:TLtO+iD8krabXxvY1F1qpBOHgOxhLWR7XsT7kQeRmMY= go.mongodb.org/mongo-driver v1.4.5/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= From 4111c9f332972e546d6f0e66b66e5b6e90714d2e Mon Sep 17 00:00:00 2001 From: fjviera Date: Tue, 15 Jun 2021 10:15:16 +0200 Subject: [PATCH 10/41] Add dynamic client registration --- client/handler.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/client/handler.go b/client/handler.go index 7e8f6a37da7..1a3d492ff1b 100644 --- a/client/handler.go +++ b/client/handler.go @@ -479,14 +479,18 @@ func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, return } - _, ok := jsonParsed.Path("access_token_ttl").Data().(float64) - if ok { - jsonParsed.Delete("access_token_ttl") + if _, ok := jsonParsed.Path("access_token_ttl").Data().(float64); ok { + if err := jsonParsed.Delete("access_token_ttl"); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } } - _, ok = jsonParsed.Path("id_token_ttl").Data().(float64) - if ok { - jsonParsed.Delete("id_token_ttl") + if _, ok := jsonParsed.Path("id_token_ttl").Data().(float64); ok { + if err := jsonParsed.Delete("id_token_ttl"); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } } c.Metadata = sqlxx.JSONRawMessage(jsonParsed.String()) } From 2bd13993e3da03e936c6cf189a9763dfe93862a9 Mon Sep 17 00:00:00 2001 From: fjviera Date: Tue, 15 Jun 2021 10:24:02 +0200 Subject: [PATCH 11/41] Add dynamic client registration --- driver/config/provider_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/config/provider_test.go b/driver/config/provider_test.go index d0bcd962616..b8f8a365d63 100644 --- a/driver/config/provider_test.go +++ b/driver/config/provider_test.go @@ -306,7 +306,7 @@ func TestViperProviderValidates(t *testing.T) { assert.Equal(t, true, c.EnforcePKCEForPublicClients()) // secrets - assert.Equal(t, []byte{0x49, 0x82, 0xdd, 0xb8, 0x8d, 0x6c, 0xdb, 0xe9, 0x43, 0xe0, 0x0, 0xb6, 0xeb, 0x22, 0x62, 0xdc, 0xe3, 0x9d, 0xf3, 0xba, 0xdd, 0x2e, 0x23, 0x2b, 0xb5, 0xdc, 0xca, 0x42, 0x75, 0xad, 0x83, 0x13}, c.GetSystemSecret()) + assert.Equal(t, []byte{0x64, 0x40, 0x5f, 0xd4, 0x66, 0xc9, 0x8c, 0x88, 0xa7, 0xf2, 0xcb, 0x95, 0xcd, 0x95, 0xcb, 0xa3, 0x41, 0x49, 0x8b, 0x97, 0xba, 0x9e, 0x92, 0xee, 0x4c, 0xaf, 0xe0, 0x71, 0x23, 0x28, 0xeb, 0xfc}, c.GetSystemSecret()) assert.Equal(t, [][]uint8{[]byte("some-random-cookie-secret")}, c.GetCookieSecrets()) // profiling From 16a3f6936c5fabd905deb514b9257302ad317214 Mon Sep 17 00:00:00 2001 From: fjvierap Date: Tue, 15 Jun 2021 11:00:43 +0200 Subject: [PATCH 12/41] Update config.yaml --- internal/config/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/config/config.yaml b/internal/config/config.yaml index c0d8e3784de..df185272584 100644 --- a/internal/config/config.yaml +++ b/internal/config/config.yaml @@ -3,7 +3,7 @@ # # !!WARNING!! # This configuration file is for documentation purposes only. Do not use it in production. As all configuration items -# are enabled, it will not work out of the box either. +# are enabled, it will not work out of the box either. # # # ORY Hydra can be configured using a configuration file and passing the file location using `--config path/to/config.yaml`. From 8d96fc77af6de86e445acede5d230393dd619862 Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Tue, 15 Jun 2021 14:01:19 +0200 Subject: [PATCH 13/41] Generate sdk --- client/handler.go | 1 + client/validator.go | 1 + client/validator_test.go | 3 +- go.mod | 8 +- go.sum | 233 ++++++++++++------ .../httpclient/client/admin/admin_client.go | 176 ------------- .../create_o_auth2_client_parameters.go | 2 +- .../create_o_auth2_client_responses.go | 2 +- .../delete_o_auth2_client_parameters.go | 2 +- .../delete_o_auth2_client_responses.go | 2 +- .../get_o_auth2_client_parameters.go | 2 +- .../get_o_auth2_client_responses.go | 2 +- .../httpclient/client/public/public_client.go | 176 +++++++++++++ .../update_o_auth2_client_parameters.go | 2 +- .../update_o_auth2_client_responses.go | 2 +- .../models/plugin_config_interface.go | 3 + spec/api.json | 12 +- 17 files changed, 365 insertions(+), 264 deletions(-) rename internal/httpclient/client/{admin => public}/create_o_auth2_client_parameters.go (99%) rename internal/httpclient/client/{admin => public}/create_o_auth2_client_responses.go (99%) rename internal/httpclient/client/{admin => public}/delete_o_auth2_client_parameters.go (99%) rename internal/httpclient/client/{admin => public}/delete_o_auth2_client_responses.go (99%) rename internal/httpclient/client/{admin => public}/get_o_auth2_client_parameters.go (99%) rename internal/httpclient/client/{admin => public}/get_o_auth2_client_responses.go (99%) rename internal/httpclient/client/{admin => public}/update_o_auth2_client_parameters.go (99%) rename internal/httpclient/client/{admin => public}/update_o_auth2_client_responses.go (99%) diff --git a/client/handler.go b/client/handler.go index 1a3d492ff1b..2ce2e465325 100644 --- a/client/handler.go +++ b/client/handler.go @@ -28,6 +28,7 @@ import ( "time" "github.com/Jeffail/gabs/v2" + "github.com/ory/x/sqlxx" "github.com/ory/x/errorsx" diff --git a/client/validator.go b/client/validator.go index b8fd72f475b..225752b6f5f 100644 --- a/client/validator.go +++ b/client/validator.go @@ -34,6 +34,7 @@ import ( "github.com/pborman/uuid" "github.com/Jeffail/gabs/v2" + "github.com/ory/x/stringslice" "github.com/ory/x/stringsx" ) diff --git a/client/validator_test.go b/client/validator_test.go index 49cb6bd08c6..557f95ab005 100644 --- a/client/validator_test.go +++ b/client/validator_test.go @@ -22,11 +22,12 @@ package client_test import ( "fmt" - "github.com/Jeffail/gabs/v2" "net/http" "net/http/httptest" "testing" + "github.com/Jeffail/gabs/v2" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" jose "gopkg.in/square/go-jose.v2" diff --git a/go.mod b/go.mod index f53ec4d639f..5d2ea2a025a 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,8 @@ replace github.com/ory/kratos/corp => github.com/ory/kratos/corp v0.0.0-20210118 replace github.com/ory/kratos-client-go => github.com/ory/kratos-client-go v0.5.4-alpha.1.0.20210210170256-960b093d8bf9 +replace github.com/seatgeek/logrus-gelf-formatter => github.com/zepatrik/logrus-gelf-formatter v0.0.0-20210305135027-b8b3731dba10 + replace github.com/dgrijalva/jwt-go => github.com/form3tech-oss/jwt-go v3.2.1+incompatible replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 @@ -45,12 +47,12 @@ require ( github.com/oleiade/reflections v1.0.1 github.com/olekukonko/tablewriter v0.0.1 github.com/ory/analytics-go/v4 v4.0.1 - github.com/ory/cli v0.0.35 + github.com/ory/cli v0.0.49 github.com/ory/fosite v0.40.2 github.com/ory/go-acc v0.2.6 github.com/ory/graceful v0.1.1 - github.com/ory/herodot v0.9.6 - github.com/ory/x v0.0.253 + github.com/ory/herodot v0.9.3 + github.com/ory/x v0.0.244 github.com/pborman/uuid v1.2.1 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 github.com/philhofer/fwd v1.1.1 // indirect diff --git a/go.sum b/go.sum index dae6ab337da..d224b62eb01 100644 --- a/go.sum +++ b/go.sum @@ -42,14 +42,23 @@ github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q github.com/DataDog/datadog-go v4.0.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.6.0+incompatible h1:t0Bg2oQPjzHChTlHKHBdAAB8CBVRySA+mcoSnzH3pLM= github.com/DataDog/datadog-go v4.6.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/HdrHistogram/hdrhistogram-go v1.0.1 h1:GX8GAYDuhlFQnI2fRDHQhTlkHMz8bEn0jTI6LJU0mpw= +github.com/HdrHistogram/hdrhistogram-go v1.0.1/go.mod h1:BWJ+nMSHY3L41Zj7CA3uXnloDp7xxV0YvstAE7nKTaM= github.com/Jeffail/gabs/v2 v2.6.1 h1:wwbE6nTQTwIMsMxzi6XFQQYRZ6wDc1mSdxoAN+9U4Gk= github.com/Jeffail/gabs/v2 v2.6.1/go.mod h1:xCn81vdHKxFUuWWAaD5jCTQDNPBMh5pPs9IJ+NcziBI= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/semver/v3 v3.0.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.0.0/go.mod h1:NEUY/Qq8Gdm2xgYA+NwJM6wmfdRV9xkh8h/Rld20R0U= +github.com/Masterminds/sprig/v3 v3.1.0 h1:j7GpgZ7PdFqNsmncycTHsLmVPf5/3wJtlgW9TNDYD9Y= +github.com/Masterminds/sprig/v3 v3.1.0/go.mod h1:ONGMf7UfYGAbMXCZmQLy8x3lCDIPrEZE/rU8pmrbihA= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -78,6 +87,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -91,8 +102,9 @@ github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:o github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/avast/retry-go v2.6.0+incompatible h1:FelcMrm7Bxacr1/RM8+/eqkDkmVN7tjlsy51dOzB3LI= github.com/avast/retry-go v2.6.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= +github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= +github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.23.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -108,14 +120,16 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm github.com/bmatcuk/doublestar/v2 v2.0.3/go.mod h1:QMmcs3H2AUQICWhfzLXz+IYln8lRQmTZRptLie8RgRw= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bwmarrin/discordgo v0.23.0 h1://ARp8qUrRZvDGMkfAjtcC20WOvsMtTgi+KrdKnl6eY= +github.com/bwmarrin/discordgo v0.23.0/go.mod h1:c1WtWUGN6nREDmzIpyTp/iD3VYt4Fpx+bVyfBG7JE+M= +github.com/bxcodec/faker/v3 v3.3.1 h1:G7uldFk+iO/ES7W4v7JlI/WU9FQ6op9VJ15YZlDEhGQ= +github.com/bxcodec/faker/v3 v3.3.1/go.mod h1:gF31YgnMSMKgkvl+fyEo1xuSMbEuieyqfeslGYFjneM= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= -github.com/cenkalti/backoff/v4 v4.1.0 h1:c8LkOFQTzuO0WBM/ae5HdGQuZPfPxp7lqBRwQRm4fSc= -github.com/cenkalti/backoff/v4 v4.1.0/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -138,7 +152,6 @@ github.com/cockroachdb/cockroach-go v0.0.0-20200312223839-f565e4789405/go.mod h1 github.com/cockroachdb/cockroach-go/v2 v2.1.1 h1:3XzfSMuUT0wBe1a3o5C0eOTcArhmmFAg2Jzh/7hhKqo= github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0= github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= @@ -152,6 +165,7 @@ github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkE github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk= github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -166,14 +180,14 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/godog v0.8.1 h1:lVb+X41I4YDreE+ibZ50bdXmySxgRviYFgKY6Aw4XE8= github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davidrjonas/semver-cli v0.0.0-20190116233701-ee19a9a0dda6/go.mod h1:+6FzxsSbK4oEuvdN06Jco8zKB2mQqIB6UduZdd0Zesk= github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/dgraph-io/ristretto v0.0.1/go.mod h1:T40EBc7CJke8TkpiYfGGKAeFjSaxuFXhuXRyumBd6RE= @@ -204,6 +218,8 @@ github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6 github.com/elastic/go-windows v1.0.0 h1:qLURgZFkkrYyTTkvYpsZIgf83AUsdIHfvlJaqaZ7aSY= github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= github.com/elazarl/goproxy v0.0.0-20181003060214-f58a169a71a5/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elnormous/contenttype v0.0.0-20210110050721-79150725153f h1:juwLa2Kbp2uwOGMOagrkTYXN/5+7sbINMmIZSluH2Gc= +github.com/elnormous/contenttype v0.0.0-20210110050721-79150725153f/go.mod h1:ngVcyGGU8pnn4QJ5sL4StrNgc/wmXZXy5IQSBuHOFPg= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -222,25 +238,31 @@ github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8S github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/form3tech-oss/jwt-go v3.2.1+incompatible h1:xdtqez379uWVJ9P3qQMX8W+F/nqsTdUvyMZB36tnacA= github.com/form3tech-oss/jwt-go v3.2.1+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/getkin/kin-openapi v0.48.0 h1:S0GfNAB2kgpB3f7Y1fCYJJV8i39KTZwswJxAjg7nT7Q= +github.com/getkin/kin-openapi v0.48.0/go.mod h1:ZJSfy1PxJv2QQvH9EdBj3nupRTVvV42mkW6zKUlRBwk= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-bindata/go-bindata v3.1.1+incompatible h1:tR4f0e4VTO7LK6B2YWyAoVEzG9ByG1wrXB4TL9+jiYg= github.com/go-bindata/go-bindata v3.1.1+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= +github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -293,6 +315,7 @@ github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98= +github.com/go-openapi/runtime v0.19.23/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= github.com/go-openapi/runtime v0.19.26 h1:K/6PoVNj5WJXUnMk+VEbELeXjtBkCS1UxTDa04tdXE0= github.com/go-openapi/runtime v0.19.26/go.mod h1:BvrQtn6iVb2QmiVXRsFAm6ZCAZBpbVKFfN6QWCp582M= @@ -314,6 +337,7 @@ github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6 github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.8/go.mod h1:qBBipho+3EoIqn6YDI+4RnQEtj6jT/IdKm+PAlXxSUc= github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= github.com/go-openapi/strfmt v0.20.0 h1:l2omNtmNbMc39IGptl9BuXBEKcZfS8zjrTsPKTiJiDM= github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= @@ -323,6 +347,7 @@ github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY= github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M= github.com/go-openapi/swag v0.19.13 h1:233UVgMy1DlmCYYfOiFpta6e2urloh+sEs5id6lyzog= github.com/go-openapi/swag v0.19.13/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= @@ -334,6 +359,14 @@ github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0 github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI= github.com/go-openapi/validate v0.20.1 h1:QGQ5CvK74E28t3DkegGweKR+auemUi5IdpMc4x3UW6s= github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= @@ -344,7 +377,8 @@ github.com/go-swagger/go-swagger v0.26.1 h1:1XUWLnH6hKxHzeKjJfA2gHkSqcT1Zgi4q/PZ github.com/go-swagger/go-swagger v0.26.1/go.mod h1:zlf/LHplZpdtU2mYXg9Ajd3+9TgHYltv5f/pEM6LjnI= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013 h1:l9rI6sNaZgNC0LnF3MiE+qTmyBA/tZAg1rtyrGbUMK0= github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.mod h1:b65mBPzqzZWxOZGxSWrqs4GInLIn+u99Q9q7p+GKni0= -github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= +github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/attrs v0.1.0/go.mod h1:fmNpaWyHM0tRm8gCZWKx8yY9fvaNLo2PyzBNSrBZ5Hw= github.com/gobuffalo/buffalo v0.12.8-0.20181004233540-fac9bb505aa8/go.mod h1:sLyT7/dceRXJUxSsE813JTQtA3Eb1vjxWfo/N//vXIY= @@ -580,6 +614,7 @@ github.com/gobuffalo/pop v4.13.1+incompatible/go.mod h1:DwBz3SD5SsHpTZiTubcsFWcV github.com/gobuffalo/pop/v5 v5.0.11/go.mod h1:mZJHJbA3cy2V18abXYuVop2ldEJ8UZ2DK6qOekC5u5g= github.com/gobuffalo/pop/v5 v5.2.0/go.mod h1:Hj586Cr7FoTFNmvzyNdUcajv3r0A+W+bkil4RIX/zKo= github.com/gobuffalo/pop/v5 v5.3.1/go.mod h1:vcEDhh6cJ3WVENqJDFt/6z7zNb7lLnlN8vj3n5G9rYA= +github.com/gobuffalo/pop/v5 v5.3.2-0.20210128124218-e397a61c1704/go.mod h1:Ey1hqzDLkWQKNEfsnafaz+3P1h/TrS++W9PmpGsNxvk= github.com/gobuffalo/pop/v5 v5.3.3/go.mod h1:Ey1hqzDLkWQKNEfsnafaz+3P1h/TrS++W9PmpGsNxvk= github.com/gobuffalo/pop/v5 v5.3.4 h1:VWH74icA8khG8SyWDAq6Ch00jcPiC4n436JMFh0lLm0= github.com/gobuffalo/pop/v5 v5.3.4/go.mod h1:UiVurv2aTKC7MuR27PnMrQjAazoLr8SoC/LuTKTS/tQ= @@ -612,6 +647,7 @@ github.com/gobuffalo/tags/v3 v3.1.0 h1:mzdCYooN2VsLRr8KIAdEZ1lh1Py7JSMsiEGCGata2 github.com/gobuffalo/tags/v3 v3.1.0/go.mod h1:ZQeN6TCTiwAFnS0dNcbDtSgZDwNKSpqajvVtt6mlYpA= github.com/gobuffalo/uuid v2.0.3+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= github.com/gobuffalo/uuid v2.0.4+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= +github.com/gobuffalo/uuid v2.0.5+incompatible h1:c5uWRuEnYggYCrT9AJm0U2v1QTG7OVDAvxhj8tIV5Gc= github.com/gobuffalo/uuid v2.0.5+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= github.com/gobuffalo/validate v2.0.3+incompatible/go.mod h1:N+EtDe0J8252BgfzQUChBgfd6L93m9weay53EWFVsMM= github.com/gobuffalo/validate v2.0.4+incompatible h1:ZTxozrIw8qQ5nfhShmc4izjYPTsPhfdXTdhXOd5OS9o= @@ -635,6 +671,7 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/gddo v0.0.0-20180828051604-96d2a289f41e/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= +github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2 h1:xisWqjiKEff2B0KfFYGpCqc3M3zdTz+OHQHRc09FeYk= github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -665,8 +702,10 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1 h1:jAbXjIeW2ZSW2AwFxlGTDoc2CjI2XujLkV3ArsZFCvc= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomarkdown/markdown v0.0.0-20201113031856-722100d81a8e h1:/Y3B7hM9H3TOWPhe8eWGBGS4r09pjvS5Z0uoPADyjmU= @@ -684,8 +723,12 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-github/v27 v27.0.1 h1:sSMFSShNn4VnqCqs+qhab6TS3uQc+uVR6TD1bW6MavM= +github.com/google/go-github/v27 v27.0.1/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0= +github.com/google/go-jsonnet v0.16.0 h1:Nb4EEOp+rdeGGyB1rQ5eisgSAqrTnhf9ip+X6lzZbY0= github.com/google/go-jsonnet v0.16.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw= -github.com/google/go-jsonnet v0.17.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -701,6 +744,7 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -737,48 +781,51 @@ github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69 h1:7xsUJsB2Nrdct github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69/go.mod h1:YLEMZOtU+AZ7dhN9T/IpGhXVGly2bvkJQ+zxj3WeVQo= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/api v1.5.0/go.mod h1:LqwrLNW876eYSuUOo4ZLHBcdKc038txr/IMfbLPATa4= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.5.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.8 h1:92lWxgpa+fF3FozM4B3UZtHZMJX8T5XT+TFdCxsPyWs= github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.2.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= -github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/serf v0.9.0/go.mod h1:YL0HO+FifKOW2u1ke99DGVu1zhcpZzNwrLIqBC7vbYU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= +github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= +github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= @@ -880,9 +927,11 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jteeuwen/go-bindata v3.0.7+incompatible/go.mod h1:JVvhzYOiGBnFSYRyV00iY8q7/0PThjIYav1p9h5dmKs= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -907,9 +956,8 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL 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.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/knadh/koanf v0.14.1-0.20201201075439-e0853799f9ec h1:fmu57yNGunS2xD2VDDAz6+6F2Qn9/9M7KOhjsOqeFGM= github.com/knadh/koanf v0.14.1-0.20201201075439-e0853799f9ec/go.mod h1:H5mEFsTeWizwFXHKtsITL5ipsLTuAMQoGuQpp+1JL9U= -github.com/knadh/koanf v1.0.0 h1:tGQ1L53Tp4uPx6agVGBN1U7A4f83ZpH3SwZNG+BkfqI= -github.com/knadh/koanf v1.0.0/go.mod h1:vrMMuhIH0k7EoxiMbVfFlRvJYmxcT2Eha3DH8Tx5+X4= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 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.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -927,6 +975,9 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -997,6 +1048,7 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -1006,23 +1058,24 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/mattn/goveralls v0.0.6 h1:cr8Y0VMo/MnEZBjxNN/vh6G90SZ7IMb6lms1dzMoO+Y= +github.com/mattn/goveralls v0.0.5/go.mod h1:Xg2LHi51faXLyKXwsndxiW6uxEEQT9+3sjGzzwU4xy0= github.com/mattn/goveralls v0.0.6/go.mod h1:h8b4ow6FxSPMQHF6o2ve3qsclnffZjYTNEKmLesRwqw= +github.com/mattn/goveralls v0.0.7 h1:vzy0i4a2iDzEFMdXIxcanRadkr0FBvSBKUmj0P8SPlQ= +github.com/mattn/goveralls v0.0.7/go.mod h1:h8b4ow6FxSPMQHF6o2ve3qsclnffZjYTNEKmLesRwqw= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/microcosm-cc/bluemonday v1.0.2 h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/mikefarah/yq v1.15.0/go.mod h1:Klb/IuhiBF3HOsJXH3YR+xURVe3KFmm0jxwiklmdjP4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -1034,12 +1087,10 @@ github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2 h1:SPoLlS9qUUnXcIY4pvA4CTwYjk0Is5f4UPEkeESr53k= github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -1110,18 +1161,21 @@ github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/ory/analytics-go/v4 v4.0.0/go.mod h1:FMx9cLRD9xN+XevPvZ5FDMfignpmcqPP6FUKnJ9/MmE= github.com/ory/analytics-go/v4 v4.0.1 h1:kKB2Mk8W0N23ZQCBHZ4wB6NQB6RxlxqzZB9LmSQ3Mho= github.com/ory/analytics-go/v4 v4.0.1/go.mod h1:FMx9cLRD9xN+XevPvZ5FDMfignpmcqPP6FUKnJ9/MmE= -github.com/ory/cli v0.0.35 h1:aAmkVq1lOlfdB/LKexFelIkajVe3RwC/IHEyFUAxbPw= github.com/ory/cli v0.0.35/go.mod h1:8iyLto6q8TiVgxbm4/D64Mt+Tavk1k18g786ZDM298Q= +github.com/ory/cli v0.0.41/go.mod h1:l5KYqpqmTB81BF+SlHwgH56Fp5IY+TMIdFKTPDkPolw= +github.com/ory/cli v0.0.49 h1:VFmctThbFr3GR9tZAQkX+C2wz8gMTi6f287cLxfMDQ4= +github.com/ory/cli v0.0.49/go.mod h1:IH1juqUjTWCVFM3PzINym92O0AACtSqQ6p/jgqaxvec= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.5.4/go.mod h1:J8ZUbNB2FOhm1cFZW9xBpDsODqsSWcyYgtJYVPcnF70= +github.com/ory/dockertest/v3 v3.6.2/go.mod h1:EFLcVUOl8qCwp9NyDAcCDtq/QviLtYswW/VbWzUnTNE= +github.com/ory/dockertest/v3 v3.6.3 h1:L8JWiGgR+fnj90AEOkTFIEp4j5uWAK72P3IUsYgn2cs= github.com/ory/dockertest/v3 v3.6.3/go.mod h1:EFLcVUOl8qCwp9NyDAcCDtq/QviLtYswW/VbWzUnTNE= -github.com/ory/dockertest/v3 v3.6.5 h1:mhNKFeVEHuvaYW+/u+59mLzM/6XXGjpaet/yApgv+yc= -github.com/ory/dockertest/v3 v3.6.5/go.mod h1:iYKQSRlYrt/2s5fJWYdB98kCQG6g/LjBMvzEYii63vg= github.com/ory/fosite v0.29.0/go.mod h1:0atSZmXO7CAcs6NPMI/Qtot8tmZYj04Nddoold4S2h0= github.com/ory/fosite v0.40.2 h1:xOS/1kPOlk1LqnAEnNXUqNGdMwvHBqw20ZbURaK+qoM= github.com/ory/fosite v0.40.2/go.mod h1:KbDZzqSDLaOLDN2haRIsBQHUhl8MQp66cYMqCpO/8Mg= github.com/ory/go-acc v0.0.0-20181118080137-ddc355013f90/go.mod h1:sxnvPCxChFuSmTJGj8FdMupeq1BezCiEpDjTUXQ4hf4= +github.com/ory/go-acc v0.1.0/go.mod h1:0omgy2aa3nDBJ45VAKeLHH8ccPBudxLeic4xiDRtug0= github.com/ory/go-acc v0.2.6 h1:YfI+L9dxI7QCtWn2RbawqO0vXhiThdXu/RgizJBbaq0= github.com/ory/go-acc v0.2.6/go.mod h1:4Kb/UnPcT8qRAk3IAxta+hvVapdxTLWtrr7bFLlEgpw= github.com/ory/go-convenience v0.1.0 h1:zouLKfF2GoSGnJwGq+PE/nJAE6dj2Zj5QlTgmMTsTS8= @@ -1135,29 +1189,48 @@ github.com/ory/graceful v0.1.1/go.mod h1:zqu70l95WrKHF4AZ6tXHvAqAvpY6M7g6ttaAVcM github.com/ory/herodot v0.6.2/go.mod h1:3BOneqcyBsVybCPAJoi92KN2BpJHcmDqAMcAAaJiJow= github.com/ory/herodot v0.7.0/go.mod h1:YXKOfAXYdQojDP5sD8m0ajowq3+QXNdtxA+QiUXBwn0= github.com/ory/herodot v0.8.3/go.mod h1:rvLjxOAlU5omtmgjCfazQX2N82EpMfl3BytBWc1jjsk= +github.com/ory/herodot v0.9.0/go.mod h1:GYF7mp8/WFRYDYJBR989lipjgx3NTjjdVdUC+hpB8mc= github.com/ory/herodot v0.9.2/go.mod h1:Da2HXR8mpwPbPrH+Gv9qV8mM5gI3v+PoJ69BA4l2RAk= -github.com/ory/herodot v0.9.6 h1:S2VSmlWgyhyogB4gH3659B3+1Pv9lJCv2a1uxigw1eg= -github.com/ory/herodot v0.9.6/go.mod h1:g3yAI/d6wPdGnOt3dbYUj5JGTZBNuUVLuuDqHnfc1lM= +github.com/ory/herodot v0.9.3 h1:vfhidpS1fafk8FzQh7lEhImkp72UUU7x0G3gM1Un5CE= +github.com/ory/herodot v0.9.3/go.mod h1:g3yAI/d6wPdGnOt3dbYUj5JGTZBNuUVLuuDqHnfc1lM= github.com/ory/jsonschema/v3 v3.0.1/go.mod h1:jgLHekkFk0uiGdEWGleC+tOm6JSSP8cbf17PnBuGXlw= +github.com/ory/jsonschema/v3 v3.0.2/go.mod h1:BPH8eu7Ws2kxeu4NRA0Pqrm15+fOJDPfQxb55v2sRXA= github.com/ory/jsonschema/v3 v3.0.3 h1:Y7KT4n84ROq8pJ3IMf9JDAulXqYKSU5xUtHjdQFbCLI= github.com/ory/jsonschema/v3 v3.0.3/go.mod h1:JvXwbx7IxAkIAo7Qo5OSC1lea+w12DtYGV8h+MTAfnA= +github.com/ory/kratos v0.5.5-alpha.1.0.20210210153145-e5a863030890/go.mod h1:TRBoejm9kt5Wvxf4uxa78FTZPmWenAGuN/BgYK5TkFI= +github.com/ory/kratos v0.5.5-alpha.1.0.20210319103511-3726ed4d145a h1:reMklzrmz6ash2RWzKqyGsPmuOPQA5todr+hohUw/bI= +github.com/ory/kratos v0.5.5-alpha.1.0.20210319103511-3726ed4d145a/go.mod h1:VdWQqc4JnfYWgAmI68rqlQqJfwKkgafRTPPm9nNnwEY= +github.com/ory/kratos-client-go v0.5.4-alpha.1.0.20210210170256-960b093d8bf9 h1:oaUuTD15+z4wv8/znC/My+YwkSHEQ/r2WrByahMcrs0= +github.com/ory/kratos-client-go v0.5.4-alpha.1.0.20210210170256-960b093d8bf9/go.mod h1:ADRXFi+QG6oLIXmYCRVoxJvuFA/hms9I2GdZyU0Nf4o= +github.com/ory/kratos/corp v0.0.0-20210118092700-c2358be1e867 h1:tlcdm9SxN/5v8AoYIR7NkNfOB/usX/8ZBMiKUaqnlX8= +github.com/ory/kratos/corp v0.0.0-20210118092700-c2358be1e867/go.mod h1:gHhPy2ShxFnqTw3SUWU5KRDf4+F54GgbldVsf6KE4R4= +github.com/ory/mail v2.3.1+incompatible h1:vHntHDHtQXamt2T+iwTTlCoBkDvILUeujE9Ocwe9md4= +github.com/ory/mail v2.3.1+incompatible/go.mod h1:87D9/1gB6ewElQoN0lXJ0ayfqcj3cW3qCTXh+5E9mfU= +github.com/ory/mail/v3 v3.0.0 h1:8LFMRj473vGahFD/ntiotWEd4S80FKYFtiZTDfOQ+sM= +github.com/ory/mail/v3 v3.0.0/go.mod h1:JGAVeZF8YAlxbaFDUHqRZAKBCSeW2w1vuxf28hFbZAw= +github.com/ory/nosurf v1.2.4 h1:UirSCPSu4nxMmcbI89G+ehZkr2QRrtdjPacia5egktI= +github.com/ory/nosurf v1.2.4/go.mod h1:d4L3ZBa7Amv55bqxCBtCs63wSlyaiCkWVl4vKf3OUxA= github.com/ory/viper v1.5.6/go.mod h1:TYmpFpKLxjQwvT4f0QPpkOn4sDXU1kDgAwJpgLYiQ28= github.com/ory/viper v1.7.4/go.mod h1:T6sodNZKNGPpashUOk7EtXz2isovz8oCd57GNVkkNmE= github.com/ory/viper v1.7.5 h1:+xVdq7SU3e1vNaCsk/ixsfxE4zylk1TJUiJrY647jUE= github.com/ory/viper v1.7.5/go.mod h1:ypOuyJmEUb3oENywQZRgeAMwqgOyDqwboO1tj3DjTaM= github.com/ory/x v0.0.84/go.mod h1:RXLPBG7B+hAViONVg0sHwK+U/ie1Y/NeXrq1JcARfoE= +github.com/ory/x v0.0.85/go.mod h1:s44V8t3xyjWZREcU+mWlp4h302rTuM4aLXcW+y5FbQ8= github.com/ory/x v0.0.93/go.mod h1:lfcTaGXpTZs7IEQAW00r9EtTCOxD//SiP5uWtNiz31g= github.com/ory/x v0.0.110/go.mod h1:DJfkE3GdakhshNhw4zlKoRaL/ozg/lcTahA9OCih2BE= github.com/ory/x v0.0.127/go.mod h1:FwUujfFuCj5d+xgLn4fGMYPnzriR5bdAIulFXMtnK0M= github.com/ory/x v0.0.166/go.mod h1:gT/3K0mSFaPllJgoFrvKYIBYI5W1Nz5RxQTJCGrIwDY= +github.com/ory/x v0.0.179/go.mod h1:SGETCUk1DgQC30bb7y4hjhkKGQ1x0YOsldrmGmy6MNc= +github.com/ory/x v0.0.181/go.mod h1:SGETCUk1DgQC30bb7y4hjhkKGQ1x0YOsldrmGmy6MNc= +github.com/ory/x v0.0.189/go.mod h1:uJK3Re/AF6F3LCNnwqzeU/ftmexCpjqwfdyrDc6PbcM= github.com/ory/x v0.0.205/go.mod h1:A1s4iwmFIppRXZLF3J9GGWeY/HpREVm0Dk5z/787iek= +github.com/ory/x v0.0.207/go.mod h1:sBgvUAcmc2lmtOBe5VMcV2vNAlADT4bkFHomG29y7N4= github.com/ory/x v0.0.212/go.mod h1:RDxYOolvMdzumYnHWha8D+RoLjYtGszyDDed4OCGC54= -github.com/ory/x v0.0.253 h1:xnLHszVEtnLqhJdxY84sT2L5g0PoLfHvVChfIq3Dj2s= -github.com/ory/x v0.0.253/go.mod h1:mntqi++7C8YOdf/sNHPb6MJ3D9klSrDyZSspIHvxiYw= +github.com/ory/x v0.0.244 h1:kBgErqR4DfRttVvSwyOP00t7dWD27gd/ZE4xeQDfwe0= +github.com/ory/x v0.0.244/go.mod h1:a15evWWm3Cc0OilqDvEFlOTyhAEHMdJQ98KkV3k9a7Y= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= @@ -1188,12 +1261,14 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/pquerna/cachecontrol v0.0.0-20200921180117-858c6e7e6b7e h1:BLqxdwZ6j771IpSCRx7s/GJjXHUE00Hmu7/YegCGdzA= github.com/pquerna/cachecontrol v0.0.0-20200921180117-858c6e7e6b7e/go.mod h1:hoLfEwdY11HjRfKFH6KqnPsfxlo3BP6bJehpDv8t6sQ= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= @@ -1209,6 +1284,7 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= @@ -1226,7 +1302,6 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rhnvrm/simples3 v0.5.0/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= -github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.0.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1249,8 +1324,6 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/santhosh-tekuri/jsonschema v1.2.4 h1:hNhW8e7t+H1vgY+1QeEQpveR6D4+OwKPXCfD2aieJis= github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= @@ -1259,9 +1332,6 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh github.com/sawadashota/encrypta v0.0.2 h1:R46/RxYmYdxI3VOt63B637OVBHzu+fazPyLo5CqK6QE= github.com/sawadashota/encrypta v0.0.2/go.mod h1:pcPebEvF012kXmZXvfVzwFEr/GUE/ZntaR805jk0nsE= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seatgeek/logrus-gelf-formatter v0.0.0-20210219220335-367fa274be2c/go.mod h1:/THDZYi7F/BsVEcYzYPqdcWFQ+1C2InkawTKfLOAnzg= -github.com/seatgeek/logrus-gelf-formatter v0.0.0-20210414080842-5b05eb8ff761 h1:0b8DF5kR0PhRoRXDiEEdzrgBc8UqVY4JWLkQJCRsLME= -github.com/seatgeek/logrus-gelf-formatter v0.0.0-20210414080842-5b05eb8ff761/go.mod h1:/THDZYi7F/BsVEcYzYPqdcWFQ+1C2InkawTKfLOAnzg= github.com/segmentio/analytics-go v3.0.1+incompatible/go.mod h1:C7CYBtQWk4vRk2RyLu0qOcbHJ18E3F1HV2C/8JvKN48= github.com/segmentio/analytics-go v3.1.0+incompatible/go.mod h1:C7CYBtQWk4vRk2RyLu0qOcbHJ18E3F1HV2C/8JvKN48= github.com/segmentio/backo-go v0.0.0-20160424052352-204274ad699c/go.mod h1:kJ9mm9YmoWSkk+oQ+5Cj8DEoRCX2JT6As4kEtIIOp1M= @@ -1278,6 +1348,7 @@ github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9Nz github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= @@ -1299,6 +1370,10 @@ github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/slack-go/slack v0.7.4 h1:Z+7CmUDV+ym4lYLA4NNLFIpr3+nDgViHrx8xsuXgrYs= +github.com/slack-go/slack v0.7.4/go.mod h1:FGqNzJBmxIsZURAxh2a8D21AnOVvvXZvGligs4npPUM= +github.com/smallstep/truststore v0.9.6 h1:vNzEJmaJL0XOZD8uouXLmYu4/aP1UQ/wHUopH3qKeYA= +github.com/smallstep/truststore v0.9.6/go.mod h1:HwHKRcBi0RUxxw1LYDpTRhYC4jZUuxPpkHdVonlkoDM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= @@ -1310,8 +1385,9 @@ github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d h1:yKm7XZV6j9 github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e h1:qpG93cPwA5f7s/ZPBJnGOYQNK/vKsaDaseuKT5Asee8= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.0/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -1350,6 +1426,7 @@ github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518 h1:iD+PFTQwKEmbwSdwfvP5ld2WEI/g7qbdhmHJ2ASfYGs= github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518/go.mod h1:CKI4AZ4XmGV240rTHfO0hfE83S6/a3/Q1siZJ/vXf7A= +github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693 h1:wD1IWQwAhdWclCwaf6DdzgCAe9Bfz1M+4AHRd7N786Y= github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693/go.mod h1:6hSY48PjDm4UObWmGLyJE9DxYVKTgR9kbCspXXJEhcU= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1369,6 +1446,8 @@ github.com/subosito/gotenv v1.1.1/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69 github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tidwall/gjson v1.3.2/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= +github.com/tidwall/gjson v1.3.5/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= +github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/gjson v1.6.8/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/gjson v1.7.1 h1:hwkZ6V1/EF8FxNhKJrIXQwSscyl2yWCZ1SkOCQYHSHA= github.com/tidwall/gjson v1.7.1/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk= @@ -1380,6 +1459,7 @@ github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8= github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/sjson v1.0.4/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y= +github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= github.com/tidwall/sjson v1.1.5 h1:wsUceI/XDyZk3J1FUvuuYlK62zJv2HO2Pzb8A5EWdUE= github.com/tidwall/sjson v1.1.5/go.mod h1:VuJzsZnTowhSxWdOgsAnb886i4AjEyTkk7tNtsL7EYE= github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= @@ -1393,8 +1473,9 @@ github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMW github.com/uber/jaeger-client-go v2.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM= github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v1.5.0/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw= github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= +github.com/uber/jaeger-lib v2.4.0+incompatible h1:fY7QsGQWiCt8pajv4r7JEvmATdCVaWxXbjwyYwsNaLQ= +github.com/uber/jaeger-lib v2.4.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/unrolled/secure v0.0.0-20180918153822-f340ee86eb8b/go.mod h1:mnPT77IAdsi/kV7+Es7y+pXALeV3h7G6dQF6mNYjcLA= @@ -1416,6 +1497,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +github.com/zepatrik/logrus-gelf-formatter v0.0.0-20210305135027-b8b3731dba10 h1:LEDqWCSheba8QLCISBZ2JDYHNN4kl6DNwTIpebE9bEQ= +github.com/zepatrik/logrus-gelf-formatter v0.0.0-20210305135027-b8b3731dba10/go.mod h1:g03kJ+ioXqOLNEIRHCsX1OoCnINQpWp0sYD61zovSbA= github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.elastic.co/apm v1.8.0 h1:AWEKpHwRal0yCMd4K8Oxy1HAa7xid+xq1yy+XjgoVU0= @@ -1446,26 +1529,20 @@ go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/contrib v0.18.0 h1:uqBh0brileIvG6luvBjdxzoFL8lxDGuhxJWsvK3BveI= go.opentelemetry.io/contrib v0.18.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.13.0/go.mod h1:TwTkyRaTam1pOIb2wxcAiC2hkMVbokXkt6DEt5nDkD8= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.18.0 h1:Qc7uU8GzpQ0Gak2oOmEcpiL9uRaVhatxkE1EzNhJW00= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.18.0/go.mod h1:iK1G0FgHurSJ/aYLg5LpnPI0pqdanM73S3dhyDp0Lk4= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.20.0 h1:ZvMGSC/Uo38s6CIYePWMFnAshVt6vvM0I0fRPXRFnLQ= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.20.0/go.mod h1:OFd9uK8rOqNvUtgeLz7/5MeIRDZPPbjnVdN4jK80j10= go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.18.0 h1:d5Of7+Zw4ANFOJB+TIn2K3QWsgS2Ht7OU9DqZHI6qu8= go.opentelemetry.io/otel v0.18.0/go.mod h1:PT5zQj4lTsR1YeARt8YNKcFb88/c2IKoSABK9mX0r78= -go.opentelemetry.io/otel v0.20.0 h1:eaP0Fqu7SXHwvjiqDq83zImeehOHX8doTvU9AwXON8g= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel/metric v0.18.0 h1:yuZCmY9e1ZTaMlZXLrrbAPmYW6tW1A5ozOZeOYGaTaY= go.opentelemetry.io/otel/metric v0.18.0/go.mod h1:kEH2QtzAyBy3xDVQfGZKIcok4ZZFvd5xyKPfPcuK6pE= -go.opentelemetry.io/otel/metric v0.20.0 h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/oteltest v0.18.0 h1:FbKDFm/LnQDOHuGjED+fy3s5YMVg0z019GJ9Er66hYo= go.opentelemetry.io/otel/oteltest v0.18.0/go.mod h1:NyierCU3/G8DLTva7KRzGii2fdxdR89zXKH1bNWY7Bo= -go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/trace v0.18.0 h1:ilCfc/fptVKaDMK1vWk0elxpolurJbEgey9J6g6s+wk= go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXSJN57AXIt/iDk= -go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1493,6 +1570,7 @@ golang.org/x/crypto v0.0.0-20181024171144-74cb1d3d52f4/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181025113841-85e1b3f9139a/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181127143415-eb0de9b17e85/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1513,11 +1591,13 @@ golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200320181102-891825fb96df/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1596,6 +1676,7 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1618,8 +1699,9 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4 h1:b0LrWgu8+q7z4J+0Y3Umo5q1dL7NXBkKBWkaVkAq17E= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181003184128-c57b0facaced/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1664,7 +1746,6 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190102155601-82a175fd1598/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190116161447-11f53e031339/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1683,8 +1764,11 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191105231009-c1f44814a5cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1717,15 +1801,16 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210319071255-635bc2c9138d h1:jbzgAvDZn8aEnytae+4ou0J0GwFZoHR0hOrTg4qH8GA= +golang.org/x/sys v0.0.0-20210319071255-635bc2c9138d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -1790,6 +1875,7 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190711191110-9a621aea19f8/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1805,6 +1891,7 @@ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20191224055732-dd894d0a8a40/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200113040837-eac381796e91/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1873,7 +1960,6 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1904,9 +1990,9 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20210318145829-90b20ab00860 h1:/u8n534a0fs4pq+41+yGfyD5HoUFPhaeVB9wb6xvNJQ= +google.golang.org/genproto v0.0.0-20210318145829-90b20ab00860/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1938,15 +2024,17 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/DataDog/dd-trace-go.v1 v1.27.0/go.mod h1:Sp1lku8WJMvNV0kjDI4Ni/T7J/U3BO5ct5kEaoVU8+I= gopkg.in/DataDog/dd-trace-go.v1 v1.27.1 h1:9BJfwtuCUrUiNB3WCTXHuaP5E/J/zfMPUUaRJoEQfdc= gopkg.in/DataDog/dd-trace-go.v1 v1.27.1/go.mod h1:Sp1lku8WJMvNV0kjDI4Ni/T7J/U3BO5ct5kEaoVU8+I= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= -gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1959,6 +2047,7 @@ gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/mold.v2 v2.2.0/go.mod h1:XMyyRsGtakkDPbxXbrA5VODo6bUXyvoDjLd5l3T0XoA= +gopkg.in/go-playground/validator.v9 v9.28.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= gopkg.in/gorp.v1 v1.7.2 h1:j3DWlAyGVv8whO7AcIWznQ2Yj7yJkn34B8s63GViAAw= gopkg.in/gorp.v1 v1.7.2/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= @@ -1969,10 +2058,10 @@ gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mail.v2 v2.0.0-20180731213649-a0242b2233b4/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= +gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.1.9/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= diff --git a/internal/httpclient/client/admin/admin_client.go b/internal/httpclient/client/admin/admin_client.go index 1b21c7fa7f2..1e3f95d9f48 100644 --- a/internal/httpclient/client/admin/admin_client.go +++ b/internal/httpclient/client/admin/admin_client.go @@ -38,14 +38,10 @@ type ClientService interface { CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ...ClientOption) (*CreateJSONWebKeySetCreated, error) - CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) - DeleteJSONWebKey(params *DeleteJSONWebKeyParams, opts ...ClientOption) (*DeleteJSONWebKeyNoContent, error) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ...ClientOption) (*DeleteJSONWebKeySetNoContent, error) - DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) - DeleteOAuth2Token(params *DeleteOAuth2TokenParams, opts ...ClientOption) (*DeleteOAuth2TokenNoContent, error) FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams, opts ...ClientOption) (*FlushInactiveOAuth2TokensNoContent, error) @@ -60,8 +56,6 @@ type ClientService interface { GetLogoutRequest(params *GetLogoutRequestParams, opts ...ClientOption) (*GetLogoutRequestOK, error) - GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) - GetVersion(params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error) IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams, opts ...ClientOption) (*IntrospectOAuth2TokenOK, error) @@ -90,8 +84,6 @@ type ClientService interface { UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ...ClientOption) (*UpdateJSONWebKeySetOK, error) - UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) - SetTransport(transport runtime.ClientTransport) } @@ -287,48 +279,6 @@ func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ... panic(msg) } -/* - CreateOAuth2Client creates an o auth 2 0 client - - Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. - -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. -*/ -func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateOAuth2ClientParams() - } - op := &runtime.ClientOperation{ - ID: "createOAuth2Client", - Method: "POST", - PathPattern: "/clients", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CreateOAuth2ClientReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateOAuth2ClientCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* DeleteJSONWebKey deletes a JSON web key @@ -413,48 +363,6 @@ func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ... panic(msg) } -/* - DeleteOAuth2Client deletes an o auth 2 0 client - - Delete an existing OAuth 2.0 Client by its ID. - -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. -*/ -func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteOAuth2ClientParams() - } - op := &runtime.ClientOperation{ - ID: "deleteOAuth2Client", - Method: "DELETE", - PathPattern: "/clients/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DeleteOAuth2ClientReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteOAuth2ClientNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* DeleteOAuth2Token deletes o auth2 access tokens from a client @@ -754,48 +662,6 @@ func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams, opts ...Client panic(msg) } -/* - GetOAuth2Client gets an o auth 2 0 client - - Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. - -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. -*/ -func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetOAuth2ClientParams() - } - op := &runtime.ClientOperation{ - ID: "getOAuth2Client", - Method: "GET", - PathPattern: "/clients/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetOAuth2ClientReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetOAuth2ClientOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* GetVersion gets service version @@ -1422,48 +1288,6 @@ func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ... panic(msg) } -/* - UpdateOAuth2Client updates an o auth 2 0 client - - Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. - -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. -*/ -func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateOAuth2ClientParams() - } - op := &runtime.ClientOperation{ - ID: "updateOAuth2Client", - Method: "PUT", - PathPattern: "/clients/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &UpdateOAuth2ClientReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateOAuth2ClientOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/internal/httpclient/client/admin/create_o_auth2_client_parameters.go b/internal/httpclient/client/public/create_o_auth2_client_parameters.go similarity index 99% rename from internal/httpclient/client/admin/create_o_auth2_client_parameters.go rename to internal/httpclient/client/public/create_o_auth2_client_parameters.go index f719021b83a..1b200ae8243 100644 --- a/internal/httpclient/client/admin/create_o_auth2_client_parameters.go +++ b/internal/httpclient/client/public/create_o_auth2_client_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package admin +package public // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/admin/create_o_auth2_client_responses.go b/internal/httpclient/client/public/create_o_auth2_client_responses.go similarity index 99% rename from internal/httpclient/client/admin/create_o_auth2_client_responses.go rename to internal/httpclient/client/public/create_o_auth2_client_responses.go index 3e2b2481b3e..30f19c72f6d 100644 --- a/internal/httpclient/client/admin/create_o_auth2_client_responses.go +++ b/internal/httpclient/client/public/create_o_auth2_client_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package admin +package public // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go b/internal/httpclient/client/public/delete_o_auth2_client_parameters.go similarity index 99% rename from internal/httpclient/client/admin/delete_o_auth2_client_parameters.go rename to internal/httpclient/client/public/delete_o_auth2_client_parameters.go index 313a6b76fdf..10d0e60a459 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go +++ b/internal/httpclient/client/public/delete_o_auth2_client_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package admin +package public // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/admin/delete_o_auth2_client_responses.go b/internal/httpclient/client/public/delete_o_auth2_client_responses.go similarity index 99% rename from internal/httpclient/client/admin/delete_o_auth2_client_responses.go rename to internal/httpclient/client/public/delete_o_auth2_client_responses.go index d929d8ae322..4e19e529023 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_client_responses.go +++ b/internal/httpclient/client/public/delete_o_auth2_client_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package admin +package public // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/admin/get_o_auth2_client_parameters.go b/internal/httpclient/client/public/get_o_auth2_client_parameters.go similarity index 99% rename from internal/httpclient/client/admin/get_o_auth2_client_parameters.go rename to internal/httpclient/client/public/get_o_auth2_client_parameters.go index f9af2c1f16f..8026d919907 100644 --- a/internal/httpclient/client/admin/get_o_auth2_client_parameters.go +++ b/internal/httpclient/client/public/get_o_auth2_client_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package admin +package public // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/admin/get_o_auth2_client_responses.go b/internal/httpclient/client/public/get_o_auth2_client_responses.go similarity index 99% rename from internal/httpclient/client/admin/get_o_auth2_client_responses.go rename to internal/httpclient/client/public/get_o_auth2_client_responses.go index 62a22c26a92..efda570ba6c 100644 --- a/internal/httpclient/client/admin/get_o_auth2_client_responses.go +++ b/internal/httpclient/client/public/get_o_auth2_client_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package admin +package public // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/public/public_client.go b/internal/httpclient/client/public/public_client.go index aed55d3e0d7..3aebd9c034f 100644 --- a/internal/httpclient/client/public/public_client.go +++ b/internal/httpclient/client/public/public_client.go @@ -30,10 +30,16 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { + CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) + + DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) + DisconnectUser(params *DisconnectUserParams, opts ...ClientOption) error DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams, opts ...ClientOption) (*DiscoverOpenIDConfigurationOK, error) + GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) + IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOption) (*IsInstanceReadyOK, error) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*Oauth2TokenOK, error) @@ -42,6 +48,8 @@ type ClientService interface { RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeOAuth2TokenOK, error) + UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) + Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UserinfoOK, error) WellKnown(params *WellKnownParams, opts ...ClientOption) (*WellKnownOK, error) @@ -49,6 +57,90 @@ type ClientService interface { SetTransport(transport runtime.ClientTransport) } +/* + CreateOAuth2Client creates an o auth 2 0 client + + Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +*/ +func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateOAuth2ClientParams() + } + op := &runtime.ClientOperation{ + ID: "createOAuth2Client", + Method: "POST", + PathPattern: "/clients", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CreateOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateOAuth2ClientCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeleteOAuth2Client deletes an o auth 2 0 client + + Delete an existing OAuth 2.0 Client by its ID. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +*/ +func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteOAuth2ClientParams() + } + op := &runtime.ClientOperation{ + ID: "deleteOAuth2Client", + Method: "DELETE", + PathPattern: "/clients/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteOAuth2ClientNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* DisconnectUser opens ID connect front backchannel enabled logout @@ -130,6 +222,48 @@ func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfiguration panic(msg) } +/* + GetOAuth2Client gets an o auth 2 0 client + + Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +*/ +func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetOAuth2ClientParams() + } + op := &runtime.ClientOperation{ + ID: "getOAuth2Client", + Method: "GET", + PathPattern: "/clients/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetOAuth2ClientOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* IsInstanceReady checks readiness status @@ -305,6 +439,48 @@ func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo run panic(msg) } +/* + UpdateOAuth2Client updates an o auth 2 0 client + + Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +*/ +func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateOAuth2ClientParams() + } + op := &runtime.ClientOperation{ + ID: "updateOAuth2Client", + Method: "PUT", + PathPattern: "/clients/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &UpdateOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateOAuth2ClientOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* Userinfo opens ID connect userinfo diff --git a/internal/httpclient/client/admin/update_o_auth2_client_parameters.go b/internal/httpclient/client/public/update_o_auth2_client_parameters.go similarity index 99% rename from internal/httpclient/client/admin/update_o_auth2_client_parameters.go rename to internal/httpclient/client/public/update_o_auth2_client_parameters.go index d767532c9a0..b26cbd6854e 100644 --- a/internal/httpclient/client/admin/update_o_auth2_client_parameters.go +++ b/internal/httpclient/client/public/update_o_auth2_client_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package admin +package public // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/admin/update_o_auth2_client_responses.go b/internal/httpclient/client/public/update_o_auth2_client_responses.go similarity index 99% rename from internal/httpclient/client/admin/update_o_auth2_client_responses.go rename to internal/httpclient/client/public/update_o_auth2_client_responses.go index d127266a4ff..c9e8bb2413a 100644 --- a/internal/httpclient/client/admin/update_o_auth2_client_responses.go +++ b/internal/httpclient/client/public/update_o_auth2_client_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package admin +package public // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/models/plugin_config_interface.go b/internal/httpclient/models/plugin_config_interface.go index 73a75d00a44..3e77cc86694 100644 --- a/internal/httpclient/models/plugin_config_interface.go +++ b/internal/httpclient/models/plugin_config_interface.go @@ -20,6 +20,9 @@ import ( // swagger:model PluginConfigInterface type PluginConfigInterface struct { + // Protocol to use for clients connecting to the plugin. + ProtocolScheme string `json:"ProtocolScheme,omitempty"` + // socket // Required: true Socket *string `json:"Socket"` diff --git a/spec/api.json b/spec/api.json index 1e73389efa4..0da8b50c371 100755 --- a/spec/api.json +++ b/spec/api.json @@ -154,7 +154,7 @@ "https" ], "tags": [ - "admin" + "public" ], "summary": "Create an OAuth 2.0 Client", "operationId": "createOAuth2Client", @@ -210,7 +210,7 @@ "https" ], "tags": [ - "admin" + "public" ], "summary": "Get an OAuth 2.0 Client.", "operationId": "getOAuth2Client", @@ -257,7 +257,7 @@ "https" ], "tags": [ - "admin" + "public" ], "summary": "Update an OAuth 2.0 Client", "operationId": "updateOAuth2Client", @@ -305,7 +305,7 @@ "https" ], "tags": [ - "admin" + "public" ], "summary": "Deletes an OAuth 2.0 Client", "operationId": "deleteOAuth2Client", @@ -2154,6 +2154,10 @@ "Types" ], "properties": { + "ProtocolScheme": { + "description": "Protocol to use for clients connecting to the plugin.", + "type": "string" + }, "Socket": { "description": "socket", "type": "string" From 33e09ac54fdb3b981a6b42e7e1cd753bd1fa2a52 Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Tue, 15 Jun 2021 15:14:55 +0200 Subject: [PATCH 14/41] Adjust sdk --- client/doc.go | 27 +++ client/handler.go | 19 +- .../openid/dynamic_client_registration.js | 16 +- .../httpclient/client/admin/admin_client.go | 176 ++++++++++++++++ .../create_o_auth2_client_parameters.go | 2 +- .../create_o_auth2_client_responses.go | 2 +- .../delete_o_auth2_client_parameters.go | 2 +- .../delete_o_auth2_client_responses.go | 2 +- .../get_o_auth2_client_parameters.go | 2 +- .../get_o_auth2_client_responses.go | 2 +- .../update_o_auth2_client_parameters.go | 2 +- .../update_o_auth2_client_responses.go | 2 +- .../create_dyn_o_auth2_client_parameters.go | 126 +++++++++++ .../create_dyn_o_auth2_client_responses.go | 181 ++++++++++++++++ .../delete_dyn_o_auth2_client_parameters.go | 149 +++++++++++++ .../delete_dyn_o_auth2_client_responses.go | 133 ++++++++++++ .../get_dyn_o_auth2_client_parameters.go | 149 +++++++++++++ .../get_dyn_o_auth2_client_responses.go | 143 +++++++++++++ .../httpclient/client/public/public_client.go | 72 +++---- .../update_dyn_o_auth2_client_parameters.go | 167 +++++++++++++++ .../update_dyn_o_auth2_client_responses.go | 105 +++++++++ .../models/plugin_config_interface.go | 3 - spec/api.json | 199 +++++++++++++++++- 23 files changed, 1610 insertions(+), 71 deletions(-) rename internal/httpclient/client/{public => admin}/create_o_auth2_client_parameters.go (99%) rename internal/httpclient/client/{public => admin}/create_o_auth2_client_responses.go (99%) rename internal/httpclient/client/{public => admin}/delete_o_auth2_client_parameters.go (99%) rename internal/httpclient/client/{public => admin}/delete_o_auth2_client_responses.go (99%) rename internal/httpclient/client/{public => admin}/get_o_auth2_client_parameters.go (99%) rename internal/httpclient/client/{public => admin}/get_o_auth2_client_responses.go (99%) rename internal/httpclient/client/{public => admin}/update_o_auth2_client_parameters.go (99%) rename internal/httpclient/client/{public => admin}/update_o_auth2_client_responses.go (99%) create mode 100644 internal/httpclient/client/public/create_dyn_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/create_dyn_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/delete_dyn_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/delete_dyn_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/get_dyn_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/get_dyn_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/update_dyn_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/update_dyn_o_auth2_client_responses.go diff --git a/client/doc.go b/client/doc.go index 974ba52077e..9e7e231581c 100644 --- a/client/doc.go +++ b/client/doc.go @@ -47,6 +47,17 @@ type swaggerUpdateClientPayload struct { Body Client } +// swagger:parameters updateDynOAuth2Client +type swaggerUpdateDynClientPayload struct { + // in: path + // required: true + ID string `json:"id"` + + // in: body + // required: true + Body Client +} + // swagger:parameters patchOAuth2Client type swaggerPatchClientPayload struct { // in: path @@ -113,6 +124,14 @@ type swaggerGetOAuth2Client struct { ID string `json:"id"` } +// swagger:parameters getDynOAuth2Client +type swaggerGetDynOAuth2Client struct { + // The id of the OAuth 2.0 Client. + // + // in: path + ID string `json:"id"` +} + // swagger:parameters deleteOAuth2Client type swaggerDeleteOAuth2Client struct { // The id of the OAuth 2.0 Client. @@ -120,3 +139,11 @@ type swaggerDeleteOAuth2Client struct { // in: path ID string `json:"id"` } + +// swagger:parameters deleteDynOAuth2Client +type swaggerDeleteDynOAuth2Client struct { + // The id of the OAuth 2.0 Client. + // + // in: path + ID string `json:"id"` +} diff --git a/client/handler.go b/client/handler.go index 2ce2e465325..233bdb8eb1a 100644 --- a/client/handler.go +++ b/client/handler.go @@ -49,7 +49,8 @@ type Handler struct { } const ( - ClientsHandlerPath = "/clients" + ClientsHandlerPath = "/clients" + DynClientsHandlerPath = "/dyn-clients" ) func NewHandler(r InternalRegistry) *Handler { @@ -67,10 +68,10 @@ func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic, dynami admin.DELETE(ClientsHandlerPath+"/:id", h.Delete) if dynamicRegistration { - public.POST(ClientsHandlerPath, h.CreateDynamicRegistration) - public.GET(ClientsHandlerPath+"/:id", h.GetDynamicRegistration) - public.PUT(ClientsHandlerPath+"/:id", h.UpdateDynamicRegistration) - public.DELETE(ClientsHandlerPath+"/:id", h.DeleteDynamicRegistration) + public.POST(DynClientsHandlerPath, h.CreateDynamicRegistration) + public.GET(DynClientsHandlerPath+"/:id", h.GetDynamicRegistration) + public.PUT(DynClientsHandlerPath+"/:id", h.UpdateDynamicRegistration) + public.DELETE(DynClientsHandlerPath+"/:id", h.DeleteDynamicRegistration) } } @@ -133,7 +134,7 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Pa h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &c) } -// swagger:route POST /clients public createOAuth2Client +// swagger:route POST /dyn-clients public createDynOAuth2Client // // Create an OAuth 2.0 Client // @@ -296,7 +297,7 @@ func (h *Handler) updateClient(ctx context.Context, c *Client) error { return nil } -// swagger:route PUT /clients/{id} public updateOAuth2Client +// swagger:route PUT /dyn-clients/{id} public updateDynOAuth2Client // // Update an OAuth 2.0 Client // @@ -440,7 +441,7 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para h.r.Writer().Write(w, r, c) } -// swagger:route GET /clients/{id} public getOAuth2Client +// swagger:route GET /dyn-clients/{id} public getDynOAuth2Client // // Get an OAuth 2.0 Client. // @@ -529,7 +530,7 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P w.WriteHeader(http.StatusNoContent) } -// swagger:route DELETE /clients/{id} public deleteOAuth2Client +// swagger:route DELETE /dyn-clients/{id} public deleteDynOAuth2Client // // Deletes an OAuth 2.0 Client // diff --git a/cypress/integration/openid/dynamic_client_registration.js b/cypress/integration/openid/dynamic_client_registration.js index 2ea1f4bcc1e..d2f8fc557f2 100644 --- a/cypress/integration/openid/dynamic_client_registration.js +++ b/cypress/integration/openid/dynamic_client_registration.js @@ -4,7 +4,7 @@ describe('The Clients Pubic Interface', function () { it('should return same client_secret given in request for newly created clients with client_secret specified', function () { cy.request({ method: 'POST', - url: Cypress.env('public_url') + '/clients', + url: Cypress.env('public_url') + '/dyn-clients', body: { client_id: 'clientid', client_name: 'clientName', @@ -21,7 +21,7 @@ describe('The Clients Pubic Interface', function () { it('should get client when having a valid client_secret in body', function () { cy.request({ method: 'GET', - url: Cypress.env('public_url') + '/clients/clientid?secret=secret' + url: Cypress.env('public_url') + '/dyn-clients/clientid?secret=secret' }).then((response) => { console.log(response.body) expect(response.body.client_name).to.equal('clientName') @@ -32,7 +32,8 @@ describe('The Clients Pubic Interface', function () { cy.request({ method: 'GET', failOnStatusCode: false, - url: Cypress.env('public_url') + '/clients/clientid?secret=wrongsecret' + url: + Cypress.env('public_url') + '/dyn-clients/clientid?secret=wrongsecret' }).then((response) => { expect(response.status).to.eq(401) }) @@ -41,7 +42,7 @@ describe('The Clients Pubic Interface', function () { it('should update client name when having a valid client_secret in body', function () { cy.request({ method: 'PUT', - url: Cypress.env('public_url') + '/clients/clientid', + url: Cypress.env('public_url') + '/dyn-clients/clientid', body: { client_id: 'clientid', client_name: 'clientName2', @@ -59,7 +60,7 @@ describe('The Clients Pubic Interface', function () { cy.request({ method: 'PUT', failOnStatusCode: false, - url: Cypress.env('public_url') + '/clients/clientid', + url: Cypress.env('public_url') + '/dyn-clients/clientid', body: { client_id: 'clientid', client_name: 'clientName2', @@ -76,7 +77,8 @@ describe('The Clients Pubic Interface', function () { cy.request({ method: 'DELETE', failOnStatusCode: false, - url: Cypress.env('public_url') + '/clients/clientid?secret=wrongsecret' + url: + Cypress.env('public_url') + '/dyn-clients/clientid?secret=wrongsecret' }).then((response) => { expect(response.status).to.eq(401) }) @@ -86,7 +88,7 @@ describe('The Clients Pubic Interface', function () { cy.request({ method: 'DELETE', failOnStatusCode: false, - url: Cypress.env('public_url') + '/clients/clientid?secret=secret' + url: Cypress.env('public_url') + '/dyn-clients/clientid?secret=secret' }).then((response) => { expect(response.status).to.eq(204) }) diff --git a/internal/httpclient/client/admin/admin_client.go b/internal/httpclient/client/admin/admin_client.go index 1e3f95d9f48..1b21c7fa7f2 100644 --- a/internal/httpclient/client/admin/admin_client.go +++ b/internal/httpclient/client/admin/admin_client.go @@ -38,10 +38,14 @@ type ClientService interface { CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ...ClientOption) (*CreateJSONWebKeySetCreated, error) + CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) + DeleteJSONWebKey(params *DeleteJSONWebKeyParams, opts ...ClientOption) (*DeleteJSONWebKeyNoContent, error) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ...ClientOption) (*DeleteJSONWebKeySetNoContent, error) + DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) + DeleteOAuth2Token(params *DeleteOAuth2TokenParams, opts ...ClientOption) (*DeleteOAuth2TokenNoContent, error) FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams, opts ...ClientOption) (*FlushInactiveOAuth2TokensNoContent, error) @@ -56,6 +60,8 @@ type ClientService interface { GetLogoutRequest(params *GetLogoutRequestParams, opts ...ClientOption) (*GetLogoutRequestOK, error) + GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) + GetVersion(params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error) IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams, opts ...ClientOption) (*IntrospectOAuth2TokenOK, error) @@ -84,6 +90,8 @@ type ClientService interface { UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ...ClientOption) (*UpdateJSONWebKeySetOK, error) + UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -279,6 +287,48 @@ func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ... panic(msg) } +/* + CreateOAuth2Client creates an o auth 2 0 client + + Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +*/ +func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateOAuth2ClientParams() + } + op := &runtime.ClientOperation{ + ID: "createOAuth2Client", + Method: "POST", + PathPattern: "/clients", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CreateOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateOAuth2ClientCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* DeleteJSONWebKey deletes a JSON web key @@ -363,6 +413,48 @@ func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ... panic(msg) } +/* + DeleteOAuth2Client deletes an o auth 2 0 client + + Delete an existing OAuth 2.0 Client by its ID. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +*/ +func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteOAuth2ClientParams() + } + op := &runtime.ClientOperation{ + ID: "deleteOAuth2Client", + Method: "DELETE", + PathPattern: "/clients/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteOAuth2ClientNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* DeleteOAuth2Token deletes o auth2 access tokens from a client @@ -662,6 +754,48 @@ func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams, opts ...Client panic(msg) } +/* + GetOAuth2Client gets an o auth 2 0 client + + Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +*/ +func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetOAuth2ClientParams() + } + op := &runtime.ClientOperation{ + ID: "getOAuth2Client", + Method: "GET", + PathPattern: "/clients/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetOAuth2ClientOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetVersion gets service version @@ -1288,6 +1422,48 @@ func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ... panic(msg) } +/* + UpdateOAuth2Client updates an o auth 2 0 client + + Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +*/ +func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateOAuth2ClientParams() + } + op := &runtime.ClientOperation{ + ID: "updateOAuth2Client", + Method: "PUT", + PathPattern: "/clients/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &UpdateOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateOAuth2ClientOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/internal/httpclient/client/public/create_o_auth2_client_parameters.go b/internal/httpclient/client/admin/create_o_auth2_client_parameters.go similarity index 99% rename from internal/httpclient/client/public/create_o_auth2_client_parameters.go rename to internal/httpclient/client/admin/create_o_auth2_client_parameters.go index 1b200ae8243..f719021b83a 100644 --- a/internal/httpclient/client/public/create_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/create_o_auth2_client_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package public +package admin // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/public/create_o_auth2_client_responses.go b/internal/httpclient/client/admin/create_o_auth2_client_responses.go similarity index 99% rename from internal/httpclient/client/public/create_o_auth2_client_responses.go rename to internal/httpclient/client/admin/create_o_auth2_client_responses.go index 30f19c72f6d..3e2b2481b3e 100644 --- a/internal/httpclient/client/public/create_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/create_o_auth2_client_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package public +package admin // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/public/delete_o_auth2_client_parameters.go b/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go similarity index 99% rename from internal/httpclient/client/public/delete_o_auth2_client_parameters.go rename to internal/httpclient/client/admin/delete_o_auth2_client_parameters.go index 10d0e60a459..313a6b76fdf 100644 --- a/internal/httpclient/client/public/delete_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package public +package admin // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/public/delete_o_auth2_client_responses.go b/internal/httpclient/client/admin/delete_o_auth2_client_responses.go similarity index 99% rename from internal/httpclient/client/public/delete_o_auth2_client_responses.go rename to internal/httpclient/client/admin/delete_o_auth2_client_responses.go index 4e19e529023..d929d8ae322 100644 --- a/internal/httpclient/client/public/delete_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/delete_o_auth2_client_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package public +package admin // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/public/get_o_auth2_client_parameters.go b/internal/httpclient/client/admin/get_o_auth2_client_parameters.go similarity index 99% rename from internal/httpclient/client/public/get_o_auth2_client_parameters.go rename to internal/httpclient/client/admin/get_o_auth2_client_parameters.go index 8026d919907..f9af2c1f16f 100644 --- a/internal/httpclient/client/public/get_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/get_o_auth2_client_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package public +package admin // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/public/get_o_auth2_client_responses.go b/internal/httpclient/client/admin/get_o_auth2_client_responses.go similarity index 99% rename from internal/httpclient/client/public/get_o_auth2_client_responses.go rename to internal/httpclient/client/admin/get_o_auth2_client_responses.go index efda570ba6c..62a22c26a92 100644 --- a/internal/httpclient/client/public/get_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/get_o_auth2_client_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package public +package admin // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/public/update_o_auth2_client_parameters.go b/internal/httpclient/client/admin/update_o_auth2_client_parameters.go similarity index 99% rename from internal/httpclient/client/public/update_o_auth2_client_parameters.go rename to internal/httpclient/client/admin/update_o_auth2_client_parameters.go index b26cbd6854e..d767532c9a0 100644 --- a/internal/httpclient/client/public/update_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/update_o_auth2_client_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package public +package admin // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/public/update_o_auth2_client_responses.go b/internal/httpclient/client/admin/update_o_auth2_client_responses.go similarity index 99% rename from internal/httpclient/client/public/update_o_auth2_client_responses.go rename to internal/httpclient/client/admin/update_o_auth2_client_responses.go index c9e8bb2413a..d127266a4ff 100644 --- a/internal/httpclient/client/public/update_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/update_o_auth2_client_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package public +package admin // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/internal/httpclient/client/public/create_dyn_o_auth2_client_parameters.go b/internal/httpclient/client/public/create_dyn_o_auth2_client_parameters.go new file mode 100644 index 00000000000..6afd4b30329 --- /dev/null +++ b/internal/httpclient/client/public/create_dyn_o_auth2_client_parameters.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateDynOAuth2ClientParams creates a new CreateDynOAuth2ClientParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateDynOAuth2ClientParams() *CreateDynOAuth2ClientParams { + return &CreateDynOAuth2ClientParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateDynOAuth2ClientParamsWithTimeout creates a new CreateDynOAuth2ClientParams object +// with the ability to set a timeout on a request. +func NewCreateDynOAuth2ClientParamsWithTimeout(timeout time.Duration) *CreateDynOAuth2ClientParams { + return &CreateDynOAuth2ClientParams{ + timeout: timeout, + } +} + +// NewCreateDynOAuth2ClientParamsWithContext creates a new CreateDynOAuth2ClientParams object +// with the ability to set a context for a request. +func NewCreateDynOAuth2ClientParamsWithContext(ctx context.Context) *CreateDynOAuth2ClientParams { + return &CreateDynOAuth2ClientParams{ + Context: ctx, + } +} + +// NewCreateDynOAuth2ClientParamsWithHTTPClient creates a new CreateDynOAuth2ClientParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateDynOAuth2ClientParamsWithHTTPClient(client *http.Client) *CreateDynOAuth2ClientParams { + return &CreateDynOAuth2ClientParams{ + HTTPClient: client, + } +} + +/* CreateDynOAuth2ClientParams contains all the parameters to send to the API endpoint + for the create dyn o auth2 client operation. + + Typically these are written to a http.Request. +*/ +type CreateDynOAuth2ClientParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create dyn o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateDynOAuth2ClientParams) WithDefaults() *CreateDynOAuth2ClientParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create dyn o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateDynOAuth2ClientParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create dyn o auth2 client params +func (o *CreateDynOAuth2ClientParams) WithTimeout(timeout time.Duration) *CreateDynOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create dyn o auth2 client params +func (o *CreateDynOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create dyn o auth2 client params +func (o *CreateDynOAuth2ClientParams) WithContext(ctx context.Context) *CreateDynOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create dyn o auth2 client params +func (o *CreateDynOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create dyn o auth2 client params +func (o *CreateDynOAuth2ClientParams) WithHTTPClient(client *http.Client) *CreateDynOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create dyn o auth2 client params +func (o *CreateDynOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateDynOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/create_dyn_o_auth2_client_responses.go b/internal/httpclient/client/public/create_dyn_o_auth2_client_responses.go new file mode 100644 index 00000000000..8914fe0f42b --- /dev/null +++ b/internal/httpclient/client/public/create_dyn_o_auth2_client_responses.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// CreateDynOAuth2ClientReader is a Reader for the CreateDynOAuth2Client structure. +type CreateDynOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateDynOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateDynOAuth2ClientCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateDynOAuth2ClientBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewCreateDynOAuth2ClientConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateDynOAuth2ClientInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateDynOAuth2ClientCreated creates a CreateDynOAuth2ClientCreated with default headers values +func NewCreateDynOAuth2ClientCreated() *CreateDynOAuth2ClientCreated { + return &CreateDynOAuth2ClientCreated{} +} + +/* CreateDynOAuth2ClientCreated describes a response with status code 201, with default header values. + +oAuth2Client +*/ +type CreateDynOAuth2ClientCreated struct { + Payload *models.OAuth2Client +} + +func (o *CreateDynOAuth2ClientCreated) Error() string { + return fmt.Sprintf("[POST /dyn-clients][%d] createDynOAuth2ClientCreated %+v", 201, o.Payload) +} +func (o *CreateDynOAuth2ClientCreated) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *CreateDynOAuth2ClientCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateDynOAuth2ClientBadRequest creates a CreateDynOAuth2ClientBadRequest with default headers values +func NewCreateDynOAuth2ClientBadRequest() *CreateDynOAuth2ClientBadRequest { + return &CreateDynOAuth2ClientBadRequest{} +} + +/* CreateDynOAuth2ClientBadRequest describes a response with status code 400, with default header values. + +genericError +*/ +type CreateDynOAuth2ClientBadRequest struct { + Payload *models.GenericError +} + +func (o *CreateDynOAuth2ClientBadRequest) Error() string { + return fmt.Sprintf("[POST /dyn-clients][%d] createDynOAuth2ClientBadRequest %+v", 400, o.Payload) +} +func (o *CreateDynOAuth2ClientBadRequest) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *CreateDynOAuth2ClientBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateDynOAuth2ClientConflict creates a CreateDynOAuth2ClientConflict with default headers values +func NewCreateDynOAuth2ClientConflict() *CreateDynOAuth2ClientConflict { + return &CreateDynOAuth2ClientConflict{} +} + +/* CreateDynOAuth2ClientConflict describes a response with status code 409, with default header values. + +genericError +*/ +type CreateDynOAuth2ClientConflict struct { + Payload *models.GenericError +} + +func (o *CreateDynOAuth2ClientConflict) Error() string { + return fmt.Sprintf("[POST /dyn-clients][%d] createDynOAuth2ClientConflict %+v", 409, o.Payload) +} +func (o *CreateDynOAuth2ClientConflict) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *CreateDynOAuth2ClientConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateDynOAuth2ClientInternalServerError creates a CreateDynOAuth2ClientInternalServerError with default headers values +func NewCreateDynOAuth2ClientInternalServerError() *CreateDynOAuth2ClientInternalServerError { + return &CreateDynOAuth2ClientInternalServerError{} +} + +/* CreateDynOAuth2ClientInternalServerError describes a response with status code 500, with default header values. + +genericError +*/ +type CreateDynOAuth2ClientInternalServerError struct { + Payload *models.GenericError +} + +func (o *CreateDynOAuth2ClientInternalServerError) Error() string { + return fmt.Sprintf("[POST /dyn-clients][%d] createDynOAuth2ClientInternalServerError %+v", 500, o.Payload) +} +func (o *CreateDynOAuth2ClientInternalServerError) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *CreateDynOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/delete_dyn_o_auth2_client_parameters.go b/internal/httpclient/client/public/delete_dyn_o_auth2_client_parameters.go new file mode 100644 index 00000000000..84466cae9b9 --- /dev/null +++ b/internal/httpclient/client/public/delete_dyn_o_auth2_client_parameters.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteDynOAuth2ClientParams creates a new DeleteDynOAuth2ClientParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteDynOAuth2ClientParams() *DeleteDynOAuth2ClientParams { + return &DeleteDynOAuth2ClientParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteDynOAuth2ClientParamsWithTimeout creates a new DeleteDynOAuth2ClientParams object +// with the ability to set a timeout on a request. +func NewDeleteDynOAuth2ClientParamsWithTimeout(timeout time.Duration) *DeleteDynOAuth2ClientParams { + return &DeleteDynOAuth2ClientParams{ + timeout: timeout, + } +} + +// NewDeleteDynOAuth2ClientParamsWithContext creates a new DeleteDynOAuth2ClientParams object +// with the ability to set a context for a request. +func NewDeleteDynOAuth2ClientParamsWithContext(ctx context.Context) *DeleteDynOAuth2ClientParams { + return &DeleteDynOAuth2ClientParams{ + Context: ctx, + } +} + +// NewDeleteDynOAuth2ClientParamsWithHTTPClient creates a new DeleteDynOAuth2ClientParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteDynOAuth2ClientParamsWithHTTPClient(client *http.Client) *DeleteDynOAuth2ClientParams { + return &DeleteDynOAuth2ClientParams{ + HTTPClient: client, + } +} + +/* DeleteDynOAuth2ClientParams contains all the parameters to send to the API endpoint + for the delete dyn o auth2 client operation. + + Typically these are written to a http.Request. +*/ +type DeleteDynOAuth2ClientParams struct { + + /* ID. + + The id of the OAuth 2.0 Client. + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete dyn o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDynOAuth2ClientParams) WithDefaults() *DeleteDynOAuth2ClientParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete dyn o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDynOAuth2ClientParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete dyn o auth2 client params +func (o *DeleteDynOAuth2ClientParams) WithTimeout(timeout time.Duration) *DeleteDynOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete dyn o auth2 client params +func (o *DeleteDynOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete dyn o auth2 client params +func (o *DeleteDynOAuth2ClientParams) WithContext(ctx context.Context) *DeleteDynOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete dyn o auth2 client params +func (o *DeleteDynOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete dyn o auth2 client params +func (o *DeleteDynOAuth2ClientParams) WithHTTPClient(client *http.Client) *DeleteDynOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete dyn o auth2 client params +func (o *DeleteDynOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the delete dyn o auth2 client params +func (o *DeleteDynOAuth2ClientParams) WithID(id string) *DeleteDynOAuth2ClientParams { + o.SetID(id) + return o +} + +// SetID adds the id to the delete dyn o auth2 client params +func (o *DeleteDynOAuth2ClientParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteDynOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/delete_dyn_o_auth2_client_responses.go b/internal/httpclient/client/public/delete_dyn_o_auth2_client_responses.go new file mode 100644 index 00000000000..25023a7ca19 --- /dev/null +++ b/internal/httpclient/client/public/delete_dyn_o_auth2_client_responses.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// DeleteDynOAuth2ClientReader is a Reader for the DeleteDynOAuth2Client structure. +type DeleteDynOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteDynOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteDynOAuth2ClientNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewDeleteDynOAuth2ClientNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteDynOAuth2ClientInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteDynOAuth2ClientNoContent creates a DeleteDynOAuth2ClientNoContent with default headers values +func NewDeleteDynOAuth2ClientNoContent() *DeleteDynOAuth2ClientNoContent { + return &DeleteDynOAuth2ClientNoContent{} +} + +/* DeleteDynOAuth2ClientNoContent describes a response with status code 204, with default header values. + + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +typically 201. +*/ +type DeleteDynOAuth2ClientNoContent struct { +} + +func (o *DeleteDynOAuth2ClientNoContent) Error() string { + return fmt.Sprintf("[DELETE /dyn-clients/{id}][%d] deleteDynOAuth2ClientNoContent ", 204) +} + +func (o *DeleteDynOAuth2ClientNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteDynOAuth2ClientNotFound creates a DeleteDynOAuth2ClientNotFound with default headers values +func NewDeleteDynOAuth2ClientNotFound() *DeleteDynOAuth2ClientNotFound { + return &DeleteDynOAuth2ClientNotFound{} +} + +/* DeleteDynOAuth2ClientNotFound describes a response with status code 404, with default header values. + +genericError +*/ +type DeleteDynOAuth2ClientNotFound struct { + Payload *models.GenericError +} + +func (o *DeleteDynOAuth2ClientNotFound) Error() string { + return fmt.Sprintf("[DELETE /dyn-clients/{id}][%d] deleteDynOAuth2ClientNotFound %+v", 404, o.Payload) +} +func (o *DeleteDynOAuth2ClientNotFound) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *DeleteDynOAuth2ClientNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteDynOAuth2ClientInternalServerError creates a DeleteDynOAuth2ClientInternalServerError with default headers values +func NewDeleteDynOAuth2ClientInternalServerError() *DeleteDynOAuth2ClientInternalServerError { + return &DeleteDynOAuth2ClientInternalServerError{} +} + +/* DeleteDynOAuth2ClientInternalServerError describes a response with status code 500, with default header values. + +genericError +*/ +type DeleteDynOAuth2ClientInternalServerError struct { + Payload *models.GenericError +} + +func (o *DeleteDynOAuth2ClientInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /dyn-clients/{id}][%d] deleteDynOAuth2ClientInternalServerError %+v", 500, o.Payload) +} +func (o *DeleteDynOAuth2ClientInternalServerError) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *DeleteDynOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/get_dyn_o_auth2_client_parameters.go b/internal/httpclient/client/public/get_dyn_o_auth2_client_parameters.go new file mode 100644 index 00000000000..a6feac0d3e3 --- /dev/null +++ b/internal/httpclient/client/public/get_dyn_o_auth2_client_parameters.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetDynOAuth2ClientParams creates a new GetDynOAuth2ClientParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetDynOAuth2ClientParams() *GetDynOAuth2ClientParams { + return &GetDynOAuth2ClientParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDynOAuth2ClientParamsWithTimeout creates a new GetDynOAuth2ClientParams object +// with the ability to set a timeout on a request. +func NewGetDynOAuth2ClientParamsWithTimeout(timeout time.Duration) *GetDynOAuth2ClientParams { + return &GetDynOAuth2ClientParams{ + timeout: timeout, + } +} + +// NewGetDynOAuth2ClientParamsWithContext creates a new GetDynOAuth2ClientParams object +// with the ability to set a context for a request. +func NewGetDynOAuth2ClientParamsWithContext(ctx context.Context) *GetDynOAuth2ClientParams { + return &GetDynOAuth2ClientParams{ + Context: ctx, + } +} + +// NewGetDynOAuth2ClientParamsWithHTTPClient creates a new GetDynOAuth2ClientParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDynOAuth2ClientParamsWithHTTPClient(client *http.Client) *GetDynOAuth2ClientParams { + return &GetDynOAuth2ClientParams{ + HTTPClient: client, + } +} + +/* GetDynOAuth2ClientParams contains all the parameters to send to the API endpoint + for the get dyn o auth2 client operation. + + Typically these are written to a http.Request. +*/ +type GetDynOAuth2ClientParams struct { + + /* ID. + + The id of the OAuth 2.0 Client. + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get dyn o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDynOAuth2ClientParams) WithDefaults() *GetDynOAuth2ClientParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get dyn o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDynOAuth2ClientParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get dyn o auth2 client params +func (o *GetDynOAuth2ClientParams) WithTimeout(timeout time.Duration) *GetDynOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get dyn o auth2 client params +func (o *GetDynOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get dyn o auth2 client params +func (o *GetDynOAuth2ClientParams) WithContext(ctx context.Context) *GetDynOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get dyn o auth2 client params +func (o *GetDynOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get dyn o auth2 client params +func (o *GetDynOAuth2ClientParams) WithHTTPClient(client *http.Client) *GetDynOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get dyn o auth2 client params +func (o *GetDynOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get dyn o auth2 client params +func (o *GetDynOAuth2ClientParams) WithID(id string) *GetDynOAuth2ClientParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get dyn o auth2 client params +func (o *GetDynOAuth2ClientParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDynOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/get_dyn_o_auth2_client_responses.go b/internal/httpclient/client/public/get_dyn_o_auth2_client_responses.go new file mode 100644 index 00000000000..d081e09d1a0 --- /dev/null +++ b/internal/httpclient/client/public/get_dyn_o_auth2_client_responses.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// GetDynOAuth2ClientReader is a Reader for the GetDynOAuth2Client structure. +type GetDynOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDynOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDynOAuth2ClientOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetDynOAuth2ClientUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDynOAuth2ClientInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetDynOAuth2ClientOK creates a GetDynOAuth2ClientOK with default headers values +func NewGetDynOAuth2ClientOK() *GetDynOAuth2ClientOK { + return &GetDynOAuth2ClientOK{} +} + +/* GetDynOAuth2ClientOK describes a response with status code 200, with default header values. + +oAuth2Client +*/ +type GetDynOAuth2ClientOK struct { + Payload *models.OAuth2Client +} + +func (o *GetDynOAuth2ClientOK) Error() string { + return fmt.Sprintf("[GET /dyn-clients/{id}][%d] getDynOAuth2ClientOK %+v", 200, o.Payload) +} +func (o *GetDynOAuth2ClientOK) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *GetDynOAuth2ClientOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDynOAuth2ClientUnauthorized creates a GetDynOAuth2ClientUnauthorized with default headers values +func NewGetDynOAuth2ClientUnauthorized() *GetDynOAuth2ClientUnauthorized { + return &GetDynOAuth2ClientUnauthorized{} +} + +/* GetDynOAuth2ClientUnauthorized describes a response with status code 401, with default header values. + +genericError +*/ +type GetDynOAuth2ClientUnauthorized struct { + Payload *models.GenericError +} + +func (o *GetDynOAuth2ClientUnauthorized) Error() string { + return fmt.Sprintf("[GET /dyn-clients/{id}][%d] getDynOAuth2ClientUnauthorized %+v", 401, o.Payload) +} +func (o *GetDynOAuth2ClientUnauthorized) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *GetDynOAuth2ClientUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDynOAuth2ClientInternalServerError creates a GetDynOAuth2ClientInternalServerError with default headers values +func NewGetDynOAuth2ClientInternalServerError() *GetDynOAuth2ClientInternalServerError { + return &GetDynOAuth2ClientInternalServerError{} +} + +/* GetDynOAuth2ClientInternalServerError describes a response with status code 500, with default header values. + +genericError +*/ +type GetDynOAuth2ClientInternalServerError struct { + Payload *models.GenericError +} + +func (o *GetDynOAuth2ClientInternalServerError) Error() string { + return fmt.Sprintf("[GET /dyn-clients/{id}][%d] getDynOAuth2ClientInternalServerError %+v", 500, o.Payload) +} +func (o *GetDynOAuth2ClientInternalServerError) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *GetDynOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/public_client.go b/internal/httpclient/client/public/public_client.go index 3aebd9c034f..ae001f72529 100644 --- a/internal/httpclient/client/public/public_client.go +++ b/internal/httpclient/client/public/public_client.go @@ -30,15 +30,15 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) + CreateDynOAuth2Client(params *CreateDynOAuth2ClientParams, opts ...ClientOption) (*CreateDynOAuth2ClientCreated, error) - DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) + DeleteDynOAuth2Client(params *DeleteDynOAuth2ClientParams, opts ...ClientOption) (*DeleteDynOAuth2ClientNoContent, error) DisconnectUser(params *DisconnectUserParams, opts ...ClientOption) error DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams, opts ...ClientOption) (*DiscoverOpenIDConfigurationOK, error) - GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) + GetDynOAuth2Client(params *GetDynOAuth2ClientParams, opts ...ClientOption) (*GetDynOAuth2ClientOK, error) IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOption) (*IsInstanceReadyOK, error) @@ -48,7 +48,7 @@ type ClientService interface { RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeOAuth2TokenOK, error) - UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) + UpdateDynOAuth2Client(params *UpdateDynOAuth2ClientParams, opts ...ClientOption) (*UpdateDynOAuth2ClientOK, error) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UserinfoOK, error) @@ -58,26 +58,26 @@ type ClientService interface { } /* - CreateOAuth2Client creates an o auth 2 0 client + CreateDynOAuth2Client creates an o auth 2 0 client Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) { +func (a *Client) CreateDynOAuth2Client(params *CreateDynOAuth2ClientParams, opts ...ClientOption) (*CreateDynOAuth2ClientCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewCreateOAuth2ClientParams() + params = NewCreateDynOAuth2ClientParams() } op := &runtime.ClientOperation{ - ID: "createOAuth2Client", + ID: "createDynOAuth2Client", Method: "POST", - PathPattern: "/clients", + PathPattern: "/dyn-clients", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &CreateOAuth2ClientReader{formats: a.formats}, + Reader: &CreateDynOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -89,37 +89,37 @@ func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...Cl if err != nil { return nil, err } - success, ok := result.(*CreateOAuth2ClientCreated) + success, ok := result.(*CreateDynOAuth2ClientCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for createDynOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - DeleteOAuth2Client deletes an o auth 2 0 client + DeleteDynOAuth2Client deletes an o auth 2 0 client Delete an existing OAuth 2.0 Client by its ID. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) { +func (a *Client) DeleteDynOAuth2Client(params *DeleteDynOAuth2ClientParams, opts ...ClientOption) (*DeleteDynOAuth2ClientNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteOAuth2ClientParams() + params = NewDeleteDynOAuth2ClientParams() } op := &runtime.ClientOperation{ - ID: "deleteOAuth2Client", + ID: "deleteDynOAuth2Client", Method: "DELETE", - PathPattern: "/clients/{id}", + PathPattern: "/dyn-clients/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &DeleteOAuth2ClientReader{formats: a.formats}, + Reader: &DeleteDynOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -131,13 +131,13 @@ func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...Cl if err != nil { return nil, err } - success, ok := result.(*DeleteOAuth2ClientNoContent) + success, ok := result.(*DeleteDynOAuth2ClientNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for deleteDynOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -223,26 +223,26 @@ func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfiguration } /* - GetOAuth2Client gets an o auth 2 0 client + GetDynOAuth2Client gets an o auth 2 0 client Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) { +func (a *Client) GetDynOAuth2Client(params *GetDynOAuth2ClientParams, opts ...ClientOption) (*GetDynOAuth2ClientOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetOAuth2ClientParams() + params = NewGetDynOAuth2ClientParams() } op := &runtime.ClientOperation{ - ID: "getOAuth2Client", + ID: "getDynOAuth2Client", Method: "GET", - PathPattern: "/clients/{id}", + PathPattern: "/dyn-clients/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &GetOAuth2ClientReader{formats: a.formats}, + Reader: &GetDynOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -254,13 +254,13 @@ func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOp if err != nil { return nil, err } - success, ok := result.(*GetOAuth2ClientOK) + success, ok := result.(*GetDynOAuth2ClientOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for getDynOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -440,26 +440,26 @@ func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo run } /* - UpdateOAuth2Client updates an o auth 2 0 client + UpdateDynOAuth2Client updates an o auth 2 0 client Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) { +func (a *Client) UpdateDynOAuth2Client(params *UpdateDynOAuth2ClientParams, opts ...ClientOption) (*UpdateDynOAuth2ClientOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewUpdateOAuth2ClientParams() + params = NewUpdateDynOAuth2ClientParams() } op := &runtime.ClientOperation{ - ID: "updateOAuth2Client", + ID: "updateDynOAuth2Client", Method: "PUT", - PathPattern: "/clients/{id}", + PathPattern: "/dyn-clients/{id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &UpdateOAuth2ClientReader{formats: a.formats}, + Reader: &UpdateDynOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -471,13 +471,13 @@ func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...Cl if err != nil { return nil, err } - success, ok := result.(*UpdateOAuth2ClientOK) + success, ok := result.(*UpdateDynOAuth2ClientOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for updateDynOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/internal/httpclient/client/public/update_dyn_o_auth2_client_parameters.go b/internal/httpclient/client/public/update_dyn_o_auth2_client_parameters.go new file mode 100644 index 00000000000..b9ce01f93a0 --- /dev/null +++ b/internal/httpclient/client/public/update_dyn_o_auth2_client_parameters.go @@ -0,0 +1,167 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// NewUpdateDynOAuth2ClientParams creates a new UpdateDynOAuth2ClientParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateDynOAuth2ClientParams() *UpdateDynOAuth2ClientParams { + return &UpdateDynOAuth2ClientParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateDynOAuth2ClientParamsWithTimeout creates a new UpdateDynOAuth2ClientParams object +// with the ability to set a timeout on a request. +func NewUpdateDynOAuth2ClientParamsWithTimeout(timeout time.Duration) *UpdateDynOAuth2ClientParams { + return &UpdateDynOAuth2ClientParams{ + timeout: timeout, + } +} + +// NewUpdateDynOAuth2ClientParamsWithContext creates a new UpdateDynOAuth2ClientParams object +// with the ability to set a context for a request. +func NewUpdateDynOAuth2ClientParamsWithContext(ctx context.Context) *UpdateDynOAuth2ClientParams { + return &UpdateDynOAuth2ClientParams{ + Context: ctx, + } +} + +// NewUpdateDynOAuth2ClientParamsWithHTTPClient creates a new UpdateDynOAuth2ClientParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateDynOAuth2ClientParamsWithHTTPClient(client *http.Client) *UpdateDynOAuth2ClientParams { + return &UpdateDynOAuth2ClientParams{ + HTTPClient: client, + } +} + +/* UpdateDynOAuth2ClientParams contains all the parameters to send to the API endpoint + for the update dyn o auth2 client operation. + + Typically these are written to a http.Request. +*/ +type UpdateDynOAuth2ClientParams struct { + + // Body. + Body *models.OAuth2Client + + // ID. + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update dyn o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateDynOAuth2ClientParams) WithDefaults() *UpdateDynOAuth2ClientParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update dyn o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateDynOAuth2ClientParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update dyn o auth2 client params +func (o *UpdateDynOAuth2ClientParams) WithTimeout(timeout time.Duration) *UpdateDynOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update dyn o auth2 client params +func (o *UpdateDynOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update dyn o auth2 client params +func (o *UpdateDynOAuth2ClientParams) WithContext(ctx context.Context) *UpdateDynOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update dyn o auth2 client params +func (o *UpdateDynOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update dyn o auth2 client params +func (o *UpdateDynOAuth2ClientParams) WithHTTPClient(client *http.Client) *UpdateDynOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update dyn o auth2 client params +func (o *UpdateDynOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the update dyn o auth2 client params +func (o *UpdateDynOAuth2ClientParams) WithBody(body *models.OAuth2Client) *UpdateDynOAuth2ClientParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update dyn o auth2 client params +func (o *UpdateDynOAuth2ClientParams) SetBody(body *models.OAuth2Client) { + o.Body = body +} + +// WithID adds the id to the update dyn o auth2 client params +func (o *UpdateDynOAuth2ClientParams) WithID(id string) *UpdateDynOAuth2ClientParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update dyn o auth2 client params +func (o *UpdateDynOAuth2ClientParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateDynOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/update_dyn_o_auth2_client_responses.go b/internal/httpclient/client/public/update_dyn_o_auth2_client_responses.go new file mode 100644 index 00000000000..7cf7c6fafc9 --- /dev/null +++ b/internal/httpclient/client/public/update_dyn_o_auth2_client_responses.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// UpdateDynOAuth2ClientReader is a Reader for the UpdateDynOAuth2Client structure. +type UpdateDynOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateDynOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateDynOAuth2ClientOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewUpdateDynOAuth2ClientInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateDynOAuth2ClientOK creates a UpdateDynOAuth2ClientOK with default headers values +func NewUpdateDynOAuth2ClientOK() *UpdateDynOAuth2ClientOK { + return &UpdateDynOAuth2ClientOK{} +} + +/* UpdateDynOAuth2ClientOK describes a response with status code 200, with default header values. + +oAuth2Client +*/ +type UpdateDynOAuth2ClientOK struct { + Payload *models.OAuth2Client +} + +func (o *UpdateDynOAuth2ClientOK) Error() string { + return fmt.Sprintf("[PUT /dyn-clients/{id}][%d] updateDynOAuth2ClientOK %+v", 200, o.Payload) +} +func (o *UpdateDynOAuth2ClientOK) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *UpdateDynOAuth2ClientOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateDynOAuth2ClientInternalServerError creates a UpdateDynOAuth2ClientInternalServerError with default headers values +func NewUpdateDynOAuth2ClientInternalServerError() *UpdateDynOAuth2ClientInternalServerError { + return &UpdateDynOAuth2ClientInternalServerError{} +} + +/* UpdateDynOAuth2ClientInternalServerError describes a response with status code 500, with default header values. + +genericError +*/ +type UpdateDynOAuth2ClientInternalServerError struct { + Payload *models.GenericError +} + +func (o *UpdateDynOAuth2ClientInternalServerError) Error() string { + return fmt.Sprintf("[PUT /dyn-clients/{id}][%d] updateDynOAuth2ClientInternalServerError %+v", 500, o.Payload) +} +func (o *UpdateDynOAuth2ClientInternalServerError) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *UpdateDynOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/models/plugin_config_interface.go b/internal/httpclient/models/plugin_config_interface.go index 3e77cc86694..73a75d00a44 100644 --- a/internal/httpclient/models/plugin_config_interface.go +++ b/internal/httpclient/models/plugin_config_interface.go @@ -20,9 +20,6 @@ import ( // swagger:model PluginConfigInterface type PluginConfigInterface struct { - // Protocol to use for clients connecting to the plugin. - ProtocolScheme string `json:"ProtocolScheme,omitempty"` - // socket // Required: true Socket *string `json:"Socket"` diff --git a/spec/api.json b/spec/api.json index 0da8b50c371..22f32ba1086 100755 --- a/spec/api.json +++ b/spec/api.json @@ -154,7 +154,7 @@ "https" ], "tags": [ - "public" + "admin" ], "summary": "Create an OAuth 2.0 Client", "operationId": "createOAuth2Client", @@ -210,7 +210,7 @@ "https" ], "tags": [ - "public" + "admin" ], "summary": "Get an OAuth 2.0 Client.", "operationId": "getOAuth2Client", @@ -257,7 +257,7 @@ "https" ], "tags": [ - "public" + "admin" ], "summary": "Update an OAuth 2.0 Client", "operationId": "updateOAuth2Client", @@ -305,7 +305,7 @@ "https" ], "tags": [ - "public" + "admin" ], "summary": "Deletes an OAuth 2.0 Client", "operationId": "deleteOAuth2Client", @@ -385,6 +385,193 @@ } } }, + "/dyn-clients": { + "post": { + "description": "Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "tags": [ + "public" + ], + "summary": "Create an OAuth 2.0 Client", + "operationId": "createDynOAuth2Client", + "responses": { + "201": { + "description": "oAuth2Client", + "schema": { + "$ref": "#/definitions/oAuth2Client" + } + }, + "400": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + }, + "409": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + }, + "500": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + } + } + } + }, + "/dyn-clients/{id}": { + "get": { + "description": "Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "tags": [ + "public" + ], + "summary": "Get an OAuth 2.0 Client.", + "operationId": "getDynOAuth2Client", + "parameters": [ + { + "type": "string", + "description": "The id of the OAuth 2.0 Client.", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "oAuth2Client", + "schema": { + "$ref": "#/definitions/oAuth2Client" + } + }, + "401": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + }, + "500": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + } + } + }, + "put": { + "description": "Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "tags": [ + "public" + ], + "summary": "Update an OAuth 2.0 Client", + "operationId": "updateDynOAuth2Client", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + }, + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/oAuth2Client" + } + } + ], + "responses": { + "200": { + "description": "oAuth2Client", + "schema": { + "$ref": "#/definitions/oAuth2Client" + } + }, + "500": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + } + } + }, + "delete": { + "description": "Delete an existing OAuth 2.0 Client by its ID.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "tags": [ + "public" + ], + "summary": "Deletes an OAuth 2.0 Client", + "operationId": "deleteDynOAuth2Client", + "parameters": [ + { + "type": "string", + "description": "The id of the OAuth 2.0 Client.", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is\ntypically 201." + }, + "404": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + }, + "500": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + } + } + } + }, "/health/alive": { "get": { "description": "This endpoint returns a 200 status code when the HTTP server is up running.\nThis status does currently not include checks whether the database connection is working.\n\nIf the service supports TLS Edge Termination, this endpoint does not require the\n`X-Forwarded-Proto` header to be set.\n\nBe aware that if you are running multiple nodes of this service, the health status will never\nrefer to the cluster state, only to a single instance.", @@ -2154,10 +2341,6 @@ "Types" ], "properties": { - "ProtocolScheme": { - "description": "Protocol to use for clients connecting to the plugin.", - "type": "string" - }, "Socket": { "description": "socket", "type": "string" From fc596887c102a8993d4782123aed055d37581660 Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Tue, 22 Jun 2021 15:55:15 +0200 Subject: [PATCH 15/41] Adjustments for dynamic client registration --- client/handler.go | 231 +++++++++++------- client/registry.go | 2 + client/validator.go | 27 +- client/validator_test.go | 10 +- .../openid/dynamic_client_registration.js | 34 ++- docs/docs/reference/configuration.md | 15 ++ driver/config/provider.go | 5 + driver/config/provider_test.go | 1 + go.mod | 1 - internal/.hydra.yaml | 1 + internal/config/config.yaml | 4 +- .../create_dyn_o_auth2_client_parameters.go | 126 ---------- .../create_dyn_o_auth2_client_responses.go | 181 -------------- ...create_o_auth2_client_public_parameters.go | 126 ++++++++++ .../create_o_auth2_client_public_responses.go | 181 ++++++++++++++ .../delete_dyn_o_auth2_client_parameters.go | 149 ----------- .../delete_dyn_o_auth2_client_responses.go | 133 ---------- ...delete_o_auth2_client_public_parameters.go | 126 ++++++++++ .../delete_o_auth2_client_public_responses.go | 133 ++++++++++ .../get_dyn_o_auth2_client_parameters.go | 149 ----------- .../get_dyn_o_auth2_client_responses.go | 143 ----------- .../get_o_auth2_client_public_parameters.go | 126 ++++++++++ .../get_o_auth2_client_public_responses.go | 143 +++++++++++ .../httpclient/client/public/public_client.go | 82 +++---- .../update_dyn_o_auth2_client_parameters.go | 167 ------------- .../update_dyn_o_auth2_client_responses.go | 105 -------- ...update_o_auth2_client_public_parameters.go | 126 ++++++++++ .../update_o_auth2_client_public_responses.go | 105 ++++++++ spec/api.json | 98 +++----- spec/config.json | 9 + 30 files changed, 1339 insertions(+), 1400 deletions(-) delete mode 100644 internal/httpclient/client/public/create_dyn_o_auth2_client_parameters.go delete mode 100644 internal/httpclient/client/public/create_dyn_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/create_o_auth2_client_public_parameters.go create mode 100644 internal/httpclient/client/public/create_o_auth2_client_public_responses.go delete mode 100644 internal/httpclient/client/public/delete_dyn_o_auth2_client_parameters.go delete mode 100644 internal/httpclient/client/public/delete_dyn_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/delete_o_auth2_client_public_parameters.go create mode 100644 internal/httpclient/client/public/delete_o_auth2_client_public_responses.go delete mode 100644 internal/httpclient/client/public/get_dyn_o_auth2_client_parameters.go delete mode 100644 internal/httpclient/client/public/get_dyn_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/get_o_auth2_client_public_parameters.go create mode 100644 internal/httpclient/client/public/get_o_auth2_client_public_responses.go delete mode 100644 internal/httpclient/client/public/update_dyn_o_auth2_client_parameters.go delete mode 100644 internal/httpclient/client/public/update_dyn_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/update_o_auth2_client_public_parameters.go create mode 100644 internal/httpclient/client/public/update_o_auth2_client_public_responses.go diff --git a/client/handler.go b/client/handler.go index 233bdb8eb1a..888adec6f18 100644 --- a/client/handler.go +++ b/client/handler.go @@ -22,14 +22,19 @@ package client import ( "context" + "encoding/base64" "encoding/json" "io" "net/http" + "strings" "time" - "github.com/Jeffail/gabs/v2" + "github.com/ory/fosite" - "github.com/ory/x/sqlxx" + "github.com/pborman/uuid" + + "github.com/ory/fosite/token/jwt" + jwtgo "github.com/ory/fosite/token/jwt" "github.com/ory/x/errorsx" @@ -50,7 +55,7 @@ type Handler struct { const ( ClientsHandlerPath = "/clients" - DynClientsHandlerPath = "/dyn-clients" + DynClientsHandlerPath = "/connect/register" ) func NewHandler(r InternalRegistry) *Handler { @@ -69,9 +74,9 @@ func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic, dynami if dynamicRegistration { public.POST(DynClientsHandlerPath, h.CreateDynamicRegistration) - public.GET(DynClientsHandlerPath+"/:id", h.GetDynamicRegistration) - public.PUT(DynClientsHandlerPath+"/:id", h.UpdateDynamicRegistration) - public.DELETE(DynClientsHandlerPath+"/:id", h.DeleteDynamicRegistration) + public.GET(DynClientsHandlerPath, h.GetDynamicRegistration) + public.PUT(DynClientsHandlerPath, h.UpdateDynamicRegistration) + public.DELETE(DynClientsHandlerPath, h.DeleteDynamicRegistration) } } @@ -98,49 +103,22 @@ func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic, dynami // 409: genericError // 500: genericError func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { - var c Client - - if err := json.NewDecoder(r.Body).Decode(&c); err != nil { + c, err := h.create(w, r, h.r.ClientValidator().Validate) + if err != nil { h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) return } - if len(c.Secret) == 0 { - secretb, err := x.GenerateSecret(26) - if err != nil { - h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) - return - } - c.Secret = string(secretb) - } - - if err := h.r.ClientValidator().Validate(&c); err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - - secret := c.Secret - c.CreatedAt = time.Now().UTC().Round(time.Second) - c.UpdatedAt = c.CreatedAt - if err := h.r.ClientManager().CreateClient(r.Context(), &c); err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - - c.Secret = "" - if !c.IsPublic() { - c.Secret = secret - } h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &c) } -// swagger:route POST /dyn-clients public createDynOAuth2Client +// swagger:route POST /connect/register public createOAuth2ClientPublic // // Create an OAuth 2.0 Client // -// Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. +// Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. // // // Consumes: @@ -157,45 +135,76 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Pa // 409: genericError // 500: genericError func (h *Handler) CreateDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - var c Client - - if err := json.NewDecoder(r.Body).Decode(&c); err != nil { + c, err := h.create(w, r, h.r.ClientValidator().ValidateDynamicRegistration) + if err != nil { h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) return } - if err := h.r.ClientValidator().ValidateDynamicRegistration(&c); err != nil { + kid, err := h.r.OpenIDJWTStrategy().GetPublicKeyID(r.Context()) + token, _, err := h.r.OpenIDJWTStrategy().Generate(r.Context(), jwtgo.MapClaims{ + "iss": h.r.ClientValidator().conf.IssuerURL().String(), + "exp": time.Now().Add(h.r.ClientValidator().conf.DynamicClientRegistrationTokenLifespan()).Unix(), + "aud": []string{c.OutfacingID}, + "iat": time.Now().UTC().Unix(), + "jti": uuid.New(), + "sid": c.GetID(), + }, &jwt.Headers{ + Extra: map[string]interface{}{"kid": kid}, + }) + if err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + b, err := json.Marshal(c) + if err != nil { h.r.Writer().WriteError(w, r, err) return } + var resp map[string]interface{} + err = json.Unmarshal(b, &resp) + if err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + resp["registration_access_token"] = token + + h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &resp) +} + +func (h *Handler) create(w http.ResponseWriter, r *http.Request, f func(*Client) error) (*Client, error) { + var c Client + + if err := json.NewDecoder(r.Body).Decode(&c); err != nil { + return nil, err + } + if len(c.Secret) == 0 { secretb, err := x.GenerateSecret(26) if err != nil { - h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) - return + return nil, err } c.Secret = string(secretb) } - if err := h.r.ClientValidator().Validate(&c); err != nil { - h.r.Writer().WriteError(w, r, err) - return + if err := f(&c); err != nil { + return nil, err } secret := c.Secret c.CreatedAt = time.Now().UTC().Round(time.Second) c.UpdatedAt = c.CreatedAt if err := h.r.ClientManager().CreateClient(r.Context(), &c); err != nil { - h.r.Writer().WriteError(w, r, err) - return + return nil, err } c.Secret = "" if !c.IsPublic() { c.Secret = secret } - h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &c) + return &c, nil } // swagger:route PUT /clients/{id} admin updateOAuth2Client @@ -297,13 +306,13 @@ func (h *Handler) updateClient(ctx context.Context, c *Client) error { return nil } -// swagger:route PUT /dyn-clients/{id} public updateDynOAuth2Client +// swagger:route PUT/connect/register public updateOAuth2ClientPublic // // Update an OAuth 2.0 Client // // Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. // // Consumes: // - application/json @@ -328,19 +337,14 @@ func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Reque if len(c.Secret) > 0 { secret = c.Secret } - if _, err := h.r.ClientManager().Authenticate(r.Context(), ps.ByName("id"), []byte(secret)); err != nil { - err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") - h.r.Writer().WriteError(w, r, err) - return - } - if err := h.r.ClientValidator().ValidateDynamicRegistration(&c); err != nil { - h.r.Writer().WriteError(w, r, err) + c.OutfacingID = r.URL.Query().Get("client_id") + if err := h.validateDynClientRegistrationAuthorization(r, c); err != nil { + h.r.Writer().WriteErrorCode(w, r, http.StatusUnauthorized, err) return } - c.OutfacingID = ps.ByName("id") - if err := h.r.ClientValidator().Validate(&c); err != nil { + if err := h.r.ClientValidator().ValidateDynamicRegistration(&c); err != nil { h.r.Writer().WriteError(w, r, err) return } @@ -441,13 +445,13 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para h.r.Writer().Write(w, r, c) } -// swagger:route GET /dyn-clients/{id} public getDynOAuth2Client +// swagger:route GET /connect/register public getOAuth2ClientPublic // // Get an OAuth 2.0 Client. // // Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. // // // Consumes: @@ -463,39 +467,22 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para // 401: genericError // 500: genericError func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - var id = ps.ByName("id") - var secret = r.URL.Query()["secret"][0] + var id = r.URL.Query().Get("client_id") - c, err := h.r.ClientManager().Authenticate(r.Context(), id, []byte(secret)) + c, err := h.r.ClientManager().GetConcreteClient(r.Context(), id) if err != nil { err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") h.r.Writer().WriteError(w, r, err) return } - c.Secret = "" - if c.Metadata != nil { - jsonParsed, err := gabs.ParseJSON(c.Metadata) - if err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - - if _, ok := jsonParsed.Path("access_token_ttl").Data().(float64); ok { - if err := jsonParsed.Delete("access_token_ttl"); err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - } - - if _, ok := jsonParsed.Path("id_token_ttl").Data().(float64); ok { - if err := jsonParsed.Delete("id_token_ttl"); err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - } - c.Metadata = sqlxx.JSONRawMessage(jsonParsed.String()) + if err := h.validateDynClientRegistrationAuthorization(r, *c); err != nil { + h.r.Writer().WriteErrorCode(w, r, http.StatusUnauthorized, err) + return } + + c.Secret = "" + c.Metadata = nil h.r.Writer().Write(w, r, c) } @@ -530,13 +517,13 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P w.WriteHeader(http.StatusNoContent) } -// swagger:route DELETE /dyn-clients/{id} public deleteDynOAuth2Client +// swagger:route DELETE /connect/register public deleteOAuth2ClientPublic // // Deletes an OAuth 2.0 Client // // Delete an existing OAuth 2.0 Client by its ID. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. // // Consumes: // - application/json @@ -551,16 +538,20 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P // 404: genericError // 500: genericError func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - var id = ps.ByName("id") - var secret = r.URL.Query()["secret"][0] + var id = r.URL.Query().Get("client_id") - _, err := h.r.ClientManager().Authenticate(r.Context(), id, []byte(secret)) + c, err := h.r.ClientManager().GetConcreteClient(r.Context(), id) if err != nil { err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") h.r.Writer().WriteError(w, r, err) return } + if err := h.validateDynClientRegistrationAuthorization(r, *c); err != nil { + h.r.Writer().WriteErrorCode(w, r, http.StatusUnauthorized, err) + return + } + if err := h.r.ClientManager().DeleteClient(r.Context(), id); err != nil { h.r.Writer().WriteError(w, r, err) return @@ -568,3 +559,57 @@ func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Reque w.WriteHeader(http.StatusNoContent) } + +func (h *Handler) validateDynClientRegistrationAuthorization(r *http.Request, c Client) error { + + // Check basic auth + if basicAuth := getBasicAuth(r); basicAuth != "" { + sDec, err := base64.StdEncoding.DecodeString(basicAuth) + if err != nil { + return herodot.ErrUnauthorized.WithReason("Invalid authorization") + } + split := strings.SplitN(string(sDec), ":", 2) + if len(split) != 2 { + return herodot.ErrUnauthorized.WithReason("Invalid authorization") + } + if c.OutfacingID != split[0] { + return herodot.ErrUnauthorized.WithReason("Invalid authorization") + } + _, err = h.r.ClientManager().Authenticate(r.Context(), split[0], []byte(split[1])) + if err != nil { + return herodot.ErrUnauthorized.WithReason("Invalid authorization") + } + return nil + } + + // Check check token + t, err := h.r.OpenIDJWTStrategy().Decode(r.Context(), fosite.AccessTokenFromRequest(r)) + if err != nil { + return herodot.ErrUnauthorized.WithReason("Error parsing access token") + } + + if !t.Valid() { + return herodot.ErrUnauthorized.WithReason("Invalid token") + } + switch sid := t.Claims["sid"].(type) { + case string: + if c.OutfacingID != sid { + return herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") + } + return nil + default: + return herodot.ErrUnauthorized.WithReason("Token does not contains a valid sid") + } + return herodot.ErrUnauthorized.WithReason("Unexpected error") +} + +func getBasicAuth(req *http.Request) string { + auth := req.Header.Get("Authorization") + split := strings.SplitN(auth, " ", 2) + if len(split) != 2 || !strings.EqualFold(split[0], "Basic") { + // Nothing in Authorization header + return "" + } + + return split[1] +} diff --git a/client/registry.go b/client/registry.go index 854c715b801..e362035047c 100644 --- a/client/registry.go +++ b/client/registry.go @@ -2,6 +2,7 @@ package client import ( "github.com/ory/fosite" + "github.com/ory/hydra/jwk" "github.com/ory/hydra/x" ) @@ -14,4 +15,5 @@ type Registry interface { ClientValidator() *Validator ClientManager() Manager ClientHasher() fosite.Hasher + OpenIDJWTStrategy() jwk.JWTStrategy } diff --git a/client/validator.go b/client/validator.go index 225752b6f5f..73df5871ccd 100644 --- a/client/validator.go +++ b/client/validator.go @@ -33,8 +33,6 @@ import ( "github.com/pborman/uuid" - "github.com/Jeffail/gabs/v2" - "github.com/ory/x/stringslice" "github.com/ory/x/stringsx" ) @@ -191,28 +189,11 @@ func (v *Validator) Validate(c *Client) error { func (v *Validator) ValidateDynamicRegistration(c *Client) error { if c.Metadata != nil { - jsonParsed, err := gabs.ParseJSON(c.Metadata) - if err != nil { - return errorsx.WithStack(ErrInvalidClientMetadata. - WithHintf(`metadata "%v" cannot be parsed'`, c.Metadata), - ) - } - - _, ok := jsonParsed.Path("access_token_ttl").Data().(float64) - if ok { - return errorsx.WithStack(ErrInvalidClientMetadata. - WithHint(`access_token_ttl cannot be set for dynamic client registration'`), - ) - } - - _, ok = jsonParsed.Path("id_token_ttl").Data().(float64) - if ok { - return errorsx.WithStack(ErrInvalidClientMetadata. - WithHint(`id_token_ttl cannot be set for dynamic client registration'`), - ) - } + return errorsx.WithStack(ErrInvalidClientMetadata. + WithHint(`metadata cannot be set for dynamic client registration'`), + ) } - return nil + return v.Validate(c) } func (v *Validator) ValidateSectorIdentifierURL(location string, redirectURIs []string) error { diff --git a/client/validator_test.go b/client/validator_test.go index 557f95ab005..6ea5d345249 100644 --- a/client/validator_test.go +++ b/client/validator_test.go @@ -26,8 +26,6 @@ import ( "net/http/httptest" "testing" - "github.com/Jeffail/gabs/v2" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" jose "gopkg.in/square/go-jose.v2" @@ -239,13 +237,7 @@ func TestValidateDynamicRegistration(t *testing.T) { RedirectURIs: []string{"https://foo/"}, Metadata: []byte("{\"anything\":10}"), }, - check: func(t *testing.T, c *Client) { - jsonParsed, err := gabs.ParseJSON(c.Metadata) - assert.Nil(t, err) - val, ok := jsonParsed.Path("anything").Data().(float64) - assert.Equal(t, float64(10), val) - assert.Equal(t, true, ok) - }, + expectErr: true, }, { in: &Client{ diff --git a/cypress/integration/openid/dynamic_client_registration.js b/cypress/integration/openid/dynamic_client_registration.js index d2f8fc557f2..aa2f294a7f6 100644 --- a/cypress/integration/openid/dynamic_client_registration.js +++ b/cypress/integration/openid/dynamic_client_registration.js @@ -1,10 +1,11 @@ import { prng } from '../../helpers' describe('The Clients Pubic Interface', function () { + it('should return same client_secret given in request for newly created clients with client_secret specified', function () { cy.request({ method: 'POST', - url: Cypress.env('public_url') + '/dyn-clients', + url: Cypress.env('public_url') + '/connect/register', body: { client_id: 'clientid', client_name: 'clientName', @@ -15,25 +16,29 @@ describe('The Clients Pubic Interface', function () { }).then((response) => { console.log(response.body) expect(response.body.client_secret).to.equal('secret') + expect(response.body.registration_access_token).to.not.be.empty }) }) it('should get client when having a valid client_secret in body', function () { cy.request({ method: 'GET', - url: Cypress.env('public_url') + '/dyn-clients/clientid?secret=secret' + url: Cypress.env('public_url') + '/connect/register?client_id=clientid', + headers: { + 'Authorization' : 'Basic Y2xpZW50aWQ6c2VjcmV0' + } }).then((response) => { console.log(response.body) expect(response.body.client_name).to.equal('clientName') }) }) - it('should fail for get client when having an invalid client_secret in body', function () { + it('should fail for get client when Authorization header is not presented', function () { cy.request({ method: 'GET', failOnStatusCode: false, url: - Cypress.env('public_url') + '/dyn-clients/clientid?secret=wrongsecret' + Cypress.env('public_url') + '/connect/register?client_id=clientid' }).then((response) => { expect(response.status).to.eq(401) }) @@ -42,7 +47,10 @@ describe('The Clients Pubic Interface', function () { it('should update client name when having a valid client_secret in body', function () { cy.request({ method: 'PUT', - url: Cypress.env('public_url') + '/dyn-clients/clientid', + url: Cypress.env('public_url') + '/connect/register?client_id=clientid', + headers: { + 'Authorization' : 'Basic Y2xpZW50aWQ6c2VjcmV0' + }, body: { client_id: 'clientid', client_name: 'clientName2', @@ -56,15 +64,14 @@ describe('The Clients Pubic Interface', function () { }) }) - it('should fail to update client name when having an invalid client_secret in body', function () { + it('should fail to update client name when Authorization header is not presented', function () { cy.request({ method: 'PUT', failOnStatusCode: false, - url: Cypress.env('public_url') + '/dyn-clients/clientid', + url: Cypress.env('public_url') + '/connect/register?client_id=clientid', body: { client_id: 'clientid', client_name: 'clientName2', - client_secret: 'wrongsecret', scope: 'foo openid offline_access', grant_types: ['client_credentials'] } @@ -73,22 +80,25 @@ describe('The Clients Pubic Interface', function () { }) }) - it('should fail to delete client when having an invalid client_secret as parameter body', function () { + it('should fail to delete client when Authorization header is not presented', function () { cy.request({ method: 'DELETE', failOnStatusCode: false, url: - Cypress.env('public_url') + '/dyn-clients/clientid?secret=wrongsecret' + Cypress.env('public_url') + '/connect/register?client_id=clientid' }).then((response) => { expect(response.status).to.eq(401) }) }) - it('should delete client when having an valid client_secret as parameter body', function () { + it('should delete client when having an valid Authorization header', function () { cy.request({ method: 'DELETE', failOnStatusCode: false, - url: Cypress.env('public_url') + '/dyn-clients/clientid?secret=secret' + url: Cypress.env('public_url') + '/connect/register?client_id=clientid', + headers: { + 'Authorization' : 'Basic Y2xpZW50aWQ6c2VjcmV0' + } }).then((response) => { expect(response.status).to.eq(204) }) diff --git a/docs/docs/reference/configuration.md b/docs/docs/reference/configuration.md index b34b983ff7f..263a75453e6 100644 --- a/docs/docs/reference/configuration.md +++ b/docs/docs/reference/configuration.md @@ -702,6 +702,7 @@ serve: # > set SERVE_PUBLIC_ALLOW_DYNAMIC_REGISTRATION= # allow_dynamic_registration: false + ## port ## # # Default value: 4444 @@ -1168,6 +1169,20 @@ ttl: # login_consent_request: 1h + ## dynamic_client_registration_token ## + # + # Configures how long a dynamic client registration are valid. + # + # Default value: 1h + # + # Set this value using environment variables on + # - Linux/macOS: + # $ export TTL_DYNAMIC_CLIENT_REGISTRATION_TOKEN= + # - Windows Command Line (CMD): + # > set TTL_DYNAMIC_CLIENT_REGISTRATION_TOKEN= + # + dynamic_client_registration_token: 1h + ## oauth2 ## # oauth2: diff --git a/driver/config/provider.go b/driver/config/provider.go index 31230954a5d..00b91923868 100644 --- a/driver/config/provider.go +++ b/driver/config/provider.go @@ -45,6 +45,7 @@ const ( KeyRefreshTokenLifespan = "ttl.refresh_token" // #nosec G101 KeyIDTokenLifespan = "ttl.id_token" // #nosec G101 KeyAuthCodeLifespan = "ttl.auth_code" + KeyDynamicClientRegistrationTokenLifespan = "ttl.dynamic_client_registration_token" KeyScopeStrategy = "strategies.scope" KeyGetCookieSecrets = "secrets.cookie" KeyGetSystemSecret = "secrets.system" @@ -250,6 +251,10 @@ func (p *Provider) AuthCodeLifespan() time.Duration { return p.p.DurationF(KeyAuthCodeLifespan, time.Minute*10) } +func (p *Provider) DynamicClientRegistrationTokenLifespan() time.Duration { + return p.p.DurationF(KeyDynamicClientRegistrationTokenLifespan, time.Hour) +} + func (p *Provider) ScopeStrategy() string { return p.p.String(KeyScopeStrategy) } diff --git a/driver/config/provider_test.go b/driver/config/provider_test.go index b8f8a365d63..1e9e58598af 100644 --- a/driver/config/provider_test.go +++ b/driver/config/provider_test.go @@ -297,6 +297,7 @@ func TestViperProviderValidates(t *testing.T) { assert.Equal(t, 2*time.Hour, c.RefreshTokenLifespan()) assert.Equal(t, 2*time.Hour, c.IDTokenLifespan()) assert.Equal(t, 2*time.Hour, c.AuthCodeLifespan()) + assert.Equal(t, 2*time.Hour, c.DynamicClientRegistrationTokenLifespan()) // oauth2 assert.Equal(t, true, c.ShareOAuth2Debug()) diff --git a/go.mod b/go.mod index 5d2ea2a025a..f77ebb39c80 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,6 @@ replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 require ( github.com/DataDog/datadog-go v4.6.0+incompatible // indirect - github.com/Jeffail/gabs/v2 v2.6.1 github.com/cenkalti/backoff/v3 v3.0.0 github.com/containerd/containerd v1.4.4 // indirect github.com/evanphx/json-patch v0.5.2 diff --git a/internal/.hydra.yaml b/internal/.hydra.yaml index 11f47550e99..0358fb35ee2 100644 --- a/internal/.hydra.yaml +++ b/internal/.hydra.yaml @@ -110,6 +110,7 @@ ttl: refresh_token: 2h id_token: 2h auth_code: 2h + dynamic_client_registration_token: 2h oauth2: expose_internal_errors: true diff --git a/internal/config/config.yaml b/internal/config/config.yaml index df185272584..e87d7f1e849 100644 --- a/internal/config/config.yaml +++ b/internal/config/config.yaml @@ -3,7 +3,7 @@ # # !!WARNING!! # This configuration file is for documentation purposes only. Do not use it in production. As all configuration items -# are enabled, it will not work out of the box either. +# are enabled, it will not work out of the box either. # # # ORY Hydra can be configured using a configuration file and passing the file location using `--config path/to/config.yaml`. @@ -370,6 +370,8 @@ ttl: id_token: 1h # configures how long auth codes are valid. Defaults to 10m. auth_code: 10m + # configures how long dynamic registration tokens are valid. Defaults to 1h. + dynamic_client_registration_token: 1h oauth2: # Set this to true if you want to share error debugging information with your OAuth 2.0 clients. diff --git a/internal/httpclient/client/public/create_dyn_o_auth2_client_parameters.go b/internal/httpclient/client/public/create_dyn_o_auth2_client_parameters.go deleted file mode 100644 index 6afd4b30329..00000000000 --- a/internal/httpclient/client/public/create_dyn_o_auth2_client_parameters.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewCreateDynOAuth2ClientParams creates a new CreateDynOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateDynOAuth2ClientParams() *CreateDynOAuth2ClientParams { - return &CreateDynOAuth2ClientParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateDynOAuth2ClientParamsWithTimeout creates a new CreateDynOAuth2ClientParams object -// with the ability to set a timeout on a request. -func NewCreateDynOAuth2ClientParamsWithTimeout(timeout time.Duration) *CreateDynOAuth2ClientParams { - return &CreateDynOAuth2ClientParams{ - timeout: timeout, - } -} - -// NewCreateDynOAuth2ClientParamsWithContext creates a new CreateDynOAuth2ClientParams object -// with the ability to set a context for a request. -func NewCreateDynOAuth2ClientParamsWithContext(ctx context.Context) *CreateDynOAuth2ClientParams { - return &CreateDynOAuth2ClientParams{ - Context: ctx, - } -} - -// NewCreateDynOAuth2ClientParamsWithHTTPClient creates a new CreateDynOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateDynOAuth2ClientParamsWithHTTPClient(client *http.Client) *CreateDynOAuth2ClientParams { - return &CreateDynOAuth2ClientParams{ - HTTPClient: client, - } -} - -/* CreateDynOAuth2ClientParams contains all the parameters to send to the API endpoint - for the create dyn o auth2 client operation. - - Typically these are written to a http.Request. -*/ -type CreateDynOAuth2ClientParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create dyn o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateDynOAuth2ClientParams) WithDefaults() *CreateDynOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create dyn o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateDynOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create dyn o auth2 client params -func (o *CreateDynOAuth2ClientParams) WithTimeout(timeout time.Duration) *CreateDynOAuth2ClientParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create dyn o auth2 client params -func (o *CreateDynOAuth2ClientParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create dyn o auth2 client params -func (o *CreateDynOAuth2ClientParams) WithContext(ctx context.Context) *CreateDynOAuth2ClientParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create dyn o auth2 client params -func (o *CreateDynOAuth2ClientParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create dyn o auth2 client params -func (o *CreateDynOAuth2ClientParams) WithHTTPClient(client *http.Client) *CreateDynOAuth2ClientParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create dyn o auth2 client params -func (o *CreateDynOAuth2ClientParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateDynOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/create_dyn_o_auth2_client_responses.go b/internal/httpclient/client/public/create_dyn_o_auth2_client_responses.go deleted file mode 100644 index 8914fe0f42b..00000000000 --- a/internal/httpclient/client/public/create_dyn_o_auth2_client_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// CreateDynOAuth2ClientReader is a Reader for the CreateDynOAuth2Client structure. -type CreateDynOAuth2ClientReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateDynOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateDynOAuth2ClientCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateDynOAuth2ClientBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreateDynOAuth2ClientConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateDynOAuth2ClientInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateDynOAuth2ClientCreated creates a CreateDynOAuth2ClientCreated with default headers values -func NewCreateDynOAuth2ClientCreated() *CreateDynOAuth2ClientCreated { - return &CreateDynOAuth2ClientCreated{} -} - -/* CreateDynOAuth2ClientCreated describes a response with status code 201, with default header values. - -oAuth2Client -*/ -type CreateDynOAuth2ClientCreated struct { - Payload *models.OAuth2Client -} - -func (o *CreateDynOAuth2ClientCreated) Error() string { - return fmt.Sprintf("[POST /dyn-clients][%d] createDynOAuth2ClientCreated %+v", 201, o.Payload) -} -func (o *CreateDynOAuth2ClientCreated) GetPayload() *models.OAuth2Client { - return o.Payload -} - -func (o *CreateDynOAuth2ClientCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OAuth2Client) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateDynOAuth2ClientBadRequest creates a CreateDynOAuth2ClientBadRequest with default headers values -func NewCreateDynOAuth2ClientBadRequest() *CreateDynOAuth2ClientBadRequest { - return &CreateDynOAuth2ClientBadRequest{} -} - -/* CreateDynOAuth2ClientBadRequest describes a response with status code 400, with default header values. - -genericError -*/ -type CreateDynOAuth2ClientBadRequest struct { - Payload *models.GenericError -} - -func (o *CreateDynOAuth2ClientBadRequest) Error() string { - return fmt.Sprintf("[POST /dyn-clients][%d] createDynOAuth2ClientBadRequest %+v", 400, o.Payload) -} -func (o *CreateDynOAuth2ClientBadRequest) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *CreateDynOAuth2ClientBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateDynOAuth2ClientConflict creates a CreateDynOAuth2ClientConflict with default headers values -func NewCreateDynOAuth2ClientConflict() *CreateDynOAuth2ClientConflict { - return &CreateDynOAuth2ClientConflict{} -} - -/* CreateDynOAuth2ClientConflict describes a response with status code 409, with default header values. - -genericError -*/ -type CreateDynOAuth2ClientConflict struct { - Payload *models.GenericError -} - -func (o *CreateDynOAuth2ClientConflict) Error() string { - return fmt.Sprintf("[POST /dyn-clients][%d] createDynOAuth2ClientConflict %+v", 409, o.Payload) -} -func (o *CreateDynOAuth2ClientConflict) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *CreateDynOAuth2ClientConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateDynOAuth2ClientInternalServerError creates a CreateDynOAuth2ClientInternalServerError with default headers values -func NewCreateDynOAuth2ClientInternalServerError() *CreateDynOAuth2ClientInternalServerError { - return &CreateDynOAuth2ClientInternalServerError{} -} - -/* CreateDynOAuth2ClientInternalServerError describes a response with status code 500, with default header values. - -genericError -*/ -type CreateDynOAuth2ClientInternalServerError struct { - Payload *models.GenericError -} - -func (o *CreateDynOAuth2ClientInternalServerError) Error() string { - return fmt.Sprintf("[POST /dyn-clients][%d] createDynOAuth2ClientInternalServerError %+v", 500, o.Payload) -} -func (o *CreateDynOAuth2ClientInternalServerError) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *CreateDynOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/create_o_auth2_client_public_parameters.go b/internal/httpclient/client/public/create_o_auth2_client_public_parameters.go new file mode 100644 index 00000000000..25f3ce99215 --- /dev/null +++ b/internal/httpclient/client/public/create_o_auth2_client_public_parameters.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateOAuth2ClientPublicParams creates a new CreateOAuth2ClientPublicParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateOAuth2ClientPublicParams() *CreateOAuth2ClientPublicParams { + return &CreateOAuth2ClientPublicParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateOAuth2ClientPublicParamsWithTimeout creates a new CreateOAuth2ClientPublicParams object +// with the ability to set a timeout on a request. +func NewCreateOAuth2ClientPublicParamsWithTimeout(timeout time.Duration) *CreateOAuth2ClientPublicParams { + return &CreateOAuth2ClientPublicParams{ + timeout: timeout, + } +} + +// NewCreateOAuth2ClientPublicParamsWithContext creates a new CreateOAuth2ClientPublicParams object +// with the ability to set a context for a request. +func NewCreateOAuth2ClientPublicParamsWithContext(ctx context.Context) *CreateOAuth2ClientPublicParams { + return &CreateOAuth2ClientPublicParams{ + Context: ctx, + } +} + +// NewCreateOAuth2ClientPublicParamsWithHTTPClient creates a new CreateOAuth2ClientPublicParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateOAuth2ClientPublicParamsWithHTTPClient(client *http.Client) *CreateOAuth2ClientPublicParams { + return &CreateOAuth2ClientPublicParams{ + HTTPClient: client, + } +} + +/* CreateOAuth2ClientPublicParams contains all the parameters to send to the API endpoint + for the create o auth2 client public operation. + + Typically these are written to a http.Request. +*/ +type CreateOAuth2ClientPublicParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create o auth2 client public params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateOAuth2ClientPublicParams) WithDefaults() *CreateOAuth2ClientPublicParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create o auth2 client public params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateOAuth2ClientPublicParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create o auth2 client public params +func (o *CreateOAuth2ClientPublicParams) WithTimeout(timeout time.Duration) *CreateOAuth2ClientPublicParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create o auth2 client public params +func (o *CreateOAuth2ClientPublicParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create o auth2 client public params +func (o *CreateOAuth2ClientPublicParams) WithContext(ctx context.Context) *CreateOAuth2ClientPublicParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create o auth2 client public params +func (o *CreateOAuth2ClientPublicParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create o auth2 client public params +func (o *CreateOAuth2ClientPublicParams) WithHTTPClient(client *http.Client) *CreateOAuth2ClientPublicParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create o auth2 client public params +func (o *CreateOAuth2ClientPublicParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateOAuth2ClientPublicParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/create_o_auth2_client_public_responses.go b/internal/httpclient/client/public/create_o_auth2_client_public_responses.go new file mode 100644 index 00000000000..4980dbf7717 --- /dev/null +++ b/internal/httpclient/client/public/create_o_auth2_client_public_responses.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// CreateOAuth2ClientPublicReader is a Reader for the CreateOAuth2ClientPublic structure. +type CreateOAuth2ClientPublicReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateOAuth2ClientPublicReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateOAuth2ClientPublicCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateOAuth2ClientPublicBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewCreateOAuth2ClientPublicConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateOAuth2ClientPublicInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewCreateOAuth2ClientPublicCreated creates a CreateOAuth2ClientPublicCreated with default headers values +func NewCreateOAuth2ClientPublicCreated() *CreateOAuth2ClientPublicCreated { + return &CreateOAuth2ClientPublicCreated{} +} + +/* CreateOAuth2ClientPublicCreated describes a response with status code 201, with default header values. + +oAuth2Client +*/ +type CreateOAuth2ClientPublicCreated struct { + Payload *models.OAuth2Client +} + +func (o *CreateOAuth2ClientPublicCreated) Error() string { + return fmt.Sprintf("[POST /connect/register][%d] createOAuth2ClientPublicCreated %+v", 201, o.Payload) +} +func (o *CreateOAuth2ClientPublicCreated) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *CreateOAuth2ClientPublicCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateOAuth2ClientPublicBadRequest creates a CreateOAuth2ClientPublicBadRequest with default headers values +func NewCreateOAuth2ClientPublicBadRequest() *CreateOAuth2ClientPublicBadRequest { + return &CreateOAuth2ClientPublicBadRequest{} +} + +/* CreateOAuth2ClientPublicBadRequest describes a response with status code 400, with default header values. + +genericError +*/ +type CreateOAuth2ClientPublicBadRequest struct { + Payload *models.GenericError +} + +func (o *CreateOAuth2ClientPublicBadRequest) Error() string { + return fmt.Sprintf("[POST /connect/register][%d] createOAuth2ClientPublicBadRequest %+v", 400, o.Payload) +} +func (o *CreateOAuth2ClientPublicBadRequest) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *CreateOAuth2ClientPublicBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateOAuth2ClientPublicConflict creates a CreateOAuth2ClientPublicConflict with default headers values +func NewCreateOAuth2ClientPublicConflict() *CreateOAuth2ClientPublicConflict { + return &CreateOAuth2ClientPublicConflict{} +} + +/* CreateOAuth2ClientPublicConflict describes a response with status code 409, with default header values. + +genericError +*/ +type CreateOAuth2ClientPublicConflict struct { + Payload *models.GenericError +} + +func (o *CreateOAuth2ClientPublicConflict) Error() string { + return fmt.Sprintf("[POST /connect/register][%d] createOAuth2ClientPublicConflict %+v", 409, o.Payload) +} +func (o *CreateOAuth2ClientPublicConflict) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *CreateOAuth2ClientPublicConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateOAuth2ClientPublicInternalServerError creates a CreateOAuth2ClientPublicInternalServerError with default headers values +func NewCreateOAuth2ClientPublicInternalServerError() *CreateOAuth2ClientPublicInternalServerError { + return &CreateOAuth2ClientPublicInternalServerError{} +} + +/* CreateOAuth2ClientPublicInternalServerError describes a response with status code 500, with default header values. + +genericError +*/ +type CreateOAuth2ClientPublicInternalServerError struct { + Payload *models.GenericError +} + +func (o *CreateOAuth2ClientPublicInternalServerError) Error() string { + return fmt.Sprintf("[POST /connect/register][%d] createOAuth2ClientPublicInternalServerError %+v", 500, o.Payload) +} +func (o *CreateOAuth2ClientPublicInternalServerError) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *CreateOAuth2ClientPublicInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/delete_dyn_o_auth2_client_parameters.go b/internal/httpclient/client/public/delete_dyn_o_auth2_client_parameters.go deleted file mode 100644 index 84466cae9b9..00000000000 --- a/internal/httpclient/client/public/delete_dyn_o_auth2_client_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteDynOAuth2ClientParams creates a new DeleteDynOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteDynOAuth2ClientParams() *DeleteDynOAuth2ClientParams { - return &DeleteDynOAuth2ClientParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteDynOAuth2ClientParamsWithTimeout creates a new DeleteDynOAuth2ClientParams object -// with the ability to set a timeout on a request. -func NewDeleteDynOAuth2ClientParamsWithTimeout(timeout time.Duration) *DeleteDynOAuth2ClientParams { - return &DeleteDynOAuth2ClientParams{ - timeout: timeout, - } -} - -// NewDeleteDynOAuth2ClientParamsWithContext creates a new DeleteDynOAuth2ClientParams object -// with the ability to set a context for a request. -func NewDeleteDynOAuth2ClientParamsWithContext(ctx context.Context) *DeleteDynOAuth2ClientParams { - return &DeleteDynOAuth2ClientParams{ - Context: ctx, - } -} - -// NewDeleteDynOAuth2ClientParamsWithHTTPClient creates a new DeleteDynOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteDynOAuth2ClientParamsWithHTTPClient(client *http.Client) *DeleteDynOAuth2ClientParams { - return &DeleteDynOAuth2ClientParams{ - HTTPClient: client, - } -} - -/* DeleteDynOAuth2ClientParams contains all the parameters to send to the API endpoint - for the delete dyn o auth2 client operation. - - Typically these are written to a http.Request. -*/ -type DeleteDynOAuth2ClientParams struct { - - /* ID. - - The id of the OAuth 2.0 Client. - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete dyn o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteDynOAuth2ClientParams) WithDefaults() *DeleteDynOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete dyn o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteDynOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete dyn o auth2 client params -func (o *DeleteDynOAuth2ClientParams) WithTimeout(timeout time.Duration) *DeleteDynOAuth2ClientParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete dyn o auth2 client params -func (o *DeleteDynOAuth2ClientParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete dyn o auth2 client params -func (o *DeleteDynOAuth2ClientParams) WithContext(ctx context.Context) *DeleteDynOAuth2ClientParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete dyn o auth2 client params -func (o *DeleteDynOAuth2ClientParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete dyn o auth2 client params -func (o *DeleteDynOAuth2ClientParams) WithHTTPClient(client *http.Client) *DeleteDynOAuth2ClientParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete dyn o auth2 client params -func (o *DeleteDynOAuth2ClientParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete dyn o auth2 client params -func (o *DeleteDynOAuth2ClientParams) WithID(id string) *DeleteDynOAuth2ClientParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete dyn o auth2 client params -func (o *DeleteDynOAuth2ClientParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteDynOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/delete_dyn_o_auth2_client_responses.go b/internal/httpclient/client/public/delete_dyn_o_auth2_client_responses.go deleted file mode 100644 index 25023a7ca19..00000000000 --- a/internal/httpclient/client/public/delete_dyn_o_auth2_client_responses.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// DeleteDynOAuth2ClientReader is a Reader for the DeleteDynOAuth2Client structure. -type DeleteDynOAuth2ClientReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteDynOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteDynOAuth2ClientNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewDeleteDynOAuth2ClientNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteDynOAuth2ClientInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteDynOAuth2ClientNoContent creates a DeleteDynOAuth2ClientNoContent with default headers values -func NewDeleteDynOAuth2ClientNoContent() *DeleteDynOAuth2ClientNoContent { - return &DeleteDynOAuth2ClientNoContent{} -} - -/* DeleteDynOAuth2ClientNoContent describes a response with status code 204, with default header values. - - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201. -*/ -type DeleteDynOAuth2ClientNoContent struct { -} - -func (o *DeleteDynOAuth2ClientNoContent) Error() string { - return fmt.Sprintf("[DELETE /dyn-clients/{id}][%d] deleteDynOAuth2ClientNoContent ", 204) -} - -func (o *DeleteDynOAuth2ClientNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteDynOAuth2ClientNotFound creates a DeleteDynOAuth2ClientNotFound with default headers values -func NewDeleteDynOAuth2ClientNotFound() *DeleteDynOAuth2ClientNotFound { - return &DeleteDynOAuth2ClientNotFound{} -} - -/* DeleteDynOAuth2ClientNotFound describes a response with status code 404, with default header values. - -genericError -*/ -type DeleteDynOAuth2ClientNotFound struct { - Payload *models.GenericError -} - -func (o *DeleteDynOAuth2ClientNotFound) Error() string { - return fmt.Sprintf("[DELETE /dyn-clients/{id}][%d] deleteDynOAuth2ClientNotFound %+v", 404, o.Payload) -} -func (o *DeleteDynOAuth2ClientNotFound) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *DeleteDynOAuth2ClientNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteDynOAuth2ClientInternalServerError creates a DeleteDynOAuth2ClientInternalServerError with default headers values -func NewDeleteDynOAuth2ClientInternalServerError() *DeleteDynOAuth2ClientInternalServerError { - return &DeleteDynOAuth2ClientInternalServerError{} -} - -/* DeleteDynOAuth2ClientInternalServerError describes a response with status code 500, with default header values. - -genericError -*/ -type DeleteDynOAuth2ClientInternalServerError struct { - Payload *models.GenericError -} - -func (o *DeleteDynOAuth2ClientInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /dyn-clients/{id}][%d] deleteDynOAuth2ClientInternalServerError %+v", 500, o.Payload) -} -func (o *DeleteDynOAuth2ClientInternalServerError) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *DeleteDynOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/delete_o_auth2_client_public_parameters.go b/internal/httpclient/client/public/delete_o_auth2_client_public_parameters.go new file mode 100644 index 00000000000..d478d7224d7 --- /dev/null +++ b/internal/httpclient/client/public/delete_o_auth2_client_public_parameters.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteOAuth2ClientPublicParams creates a new DeleteOAuth2ClientPublicParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteOAuth2ClientPublicParams() *DeleteOAuth2ClientPublicParams { + return &DeleteOAuth2ClientPublicParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteOAuth2ClientPublicParamsWithTimeout creates a new DeleteOAuth2ClientPublicParams object +// with the ability to set a timeout on a request. +func NewDeleteOAuth2ClientPublicParamsWithTimeout(timeout time.Duration) *DeleteOAuth2ClientPublicParams { + return &DeleteOAuth2ClientPublicParams{ + timeout: timeout, + } +} + +// NewDeleteOAuth2ClientPublicParamsWithContext creates a new DeleteOAuth2ClientPublicParams object +// with the ability to set a context for a request. +func NewDeleteOAuth2ClientPublicParamsWithContext(ctx context.Context) *DeleteOAuth2ClientPublicParams { + return &DeleteOAuth2ClientPublicParams{ + Context: ctx, + } +} + +// NewDeleteOAuth2ClientPublicParamsWithHTTPClient creates a new DeleteOAuth2ClientPublicParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteOAuth2ClientPublicParamsWithHTTPClient(client *http.Client) *DeleteOAuth2ClientPublicParams { + return &DeleteOAuth2ClientPublicParams{ + HTTPClient: client, + } +} + +/* DeleteOAuth2ClientPublicParams contains all the parameters to send to the API endpoint + for the delete o auth2 client public operation. + + Typically these are written to a http.Request. +*/ +type DeleteOAuth2ClientPublicParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete o auth2 client public params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteOAuth2ClientPublicParams) WithDefaults() *DeleteOAuth2ClientPublicParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete o auth2 client public params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteOAuth2ClientPublicParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete o auth2 client public params +func (o *DeleteOAuth2ClientPublicParams) WithTimeout(timeout time.Duration) *DeleteOAuth2ClientPublicParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete o auth2 client public params +func (o *DeleteOAuth2ClientPublicParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete o auth2 client public params +func (o *DeleteOAuth2ClientPublicParams) WithContext(ctx context.Context) *DeleteOAuth2ClientPublicParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete o auth2 client public params +func (o *DeleteOAuth2ClientPublicParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete o auth2 client public params +func (o *DeleteOAuth2ClientPublicParams) WithHTTPClient(client *http.Client) *DeleteOAuth2ClientPublicParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete o auth2 client public params +func (o *DeleteOAuth2ClientPublicParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteOAuth2ClientPublicParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/delete_o_auth2_client_public_responses.go b/internal/httpclient/client/public/delete_o_auth2_client_public_responses.go new file mode 100644 index 00000000000..4f14a3602fb --- /dev/null +++ b/internal/httpclient/client/public/delete_o_auth2_client_public_responses.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// DeleteOAuth2ClientPublicReader is a Reader for the DeleteOAuth2ClientPublic structure. +type DeleteOAuth2ClientPublicReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteOAuth2ClientPublicReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteOAuth2ClientPublicNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewDeleteOAuth2ClientPublicNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteOAuth2ClientPublicInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteOAuth2ClientPublicNoContent creates a DeleteOAuth2ClientPublicNoContent with default headers values +func NewDeleteOAuth2ClientPublicNoContent() *DeleteOAuth2ClientPublicNoContent { + return &DeleteOAuth2ClientPublicNoContent{} +} + +/* DeleteOAuth2ClientPublicNoContent describes a response with status code 204, with default header values. + + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +typically 201. +*/ +type DeleteOAuth2ClientPublicNoContent struct { +} + +func (o *DeleteOAuth2ClientPublicNoContent) Error() string { + return fmt.Sprintf("[DELETE /connect/register][%d] deleteOAuth2ClientPublicNoContent ", 204) +} + +func (o *DeleteOAuth2ClientPublicNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteOAuth2ClientPublicNotFound creates a DeleteOAuth2ClientPublicNotFound with default headers values +func NewDeleteOAuth2ClientPublicNotFound() *DeleteOAuth2ClientPublicNotFound { + return &DeleteOAuth2ClientPublicNotFound{} +} + +/* DeleteOAuth2ClientPublicNotFound describes a response with status code 404, with default header values. + +genericError +*/ +type DeleteOAuth2ClientPublicNotFound struct { + Payload *models.GenericError +} + +func (o *DeleteOAuth2ClientPublicNotFound) Error() string { + return fmt.Sprintf("[DELETE /connect/register][%d] deleteOAuth2ClientPublicNotFound %+v", 404, o.Payload) +} +func (o *DeleteOAuth2ClientPublicNotFound) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *DeleteOAuth2ClientPublicNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteOAuth2ClientPublicInternalServerError creates a DeleteOAuth2ClientPublicInternalServerError with default headers values +func NewDeleteOAuth2ClientPublicInternalServerError() *DeleteOAuth2ClientPublicInternalServerError { + return &DeleteOAuth2ClientPublicInternalServerError{} +} + +/* DeleteOAuth2ClientPublicInternalServerError describes a response with status code 500, with default header values. + +genericError +*/ +type DeleteOAuth2ClientPublicInternalServerError struct { + Payload *models.GenericError +} + +func (o *DeleteOAuth2ClientPublicInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /connect/register][%d] deleteOAuth2ClientPublicInternalServerError %+v", 500, o.Payload) +} +func (o *DeleteOAuth2ClientPublicInternalServerError) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *DeleteOAuth2ClientPublicInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/get_dyn_o_auth2_client_parameters.go b/internal/httpclient/client/public/get_dyn_o_auth2_client_parameters.go deleted file mode 100644 index a6feac0d3e3..00000000000 --- a/internal/httpclient/client/public/get_dyn_o_auth2_client_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetDynOAuth2ClientParams creates a new GetDynOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetDynOAuth2ClientParams() *GetDynOAuth2ClientParams { - return &GetDynOAuth2ClientParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetDynOAuth2ClientParamsWithTimeout creates a new GetDynOAuth2ClientParams object -// with the ability to set a timeout on a request. -func NewGetDynOAuth2ClientParamsWithTimeout(timeout time.Duration) *GetDynOAuth2ClientParams { - return &GetDynOAuth2ClientParams{ - timeout: timeout, - } -} - -// NewGetDynOAuth2ClientParamsWithContext creates a new GetDynOAuth2ClientParams object -// with the ability to set a context for a request. -func NewGetDynOAuth2ClientParamsWithContext(ctx context.Context) *GetDynOAuth2ClientParams { - return &GetDynOAuth2ClientParams{ - Context: ctx, - } -} - -// NewGetDynOAuth2ClientParamsWithHTTPClient creates a new GetDynOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetDynOAuth2ClientParamsWithHTTPClient(client *http.Client) *GetDynOAuth2ClientParams { - return &GetDynOAuth2ClientParams{ - HTTPClient: client, - } -} - -/* GetDynOAuth2ClientParams contains all the parameters to send to the API endpoint - for the get dyn o auth2 client operation. - - Typically these are written to a http.Request. -*/ -type GetDynOAuth2ClientParams struct { - - /* ID. - - The id of the OAuth 2.0 Client. - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get dyn o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetDynOAuth2ClientParams) WithDefaults() *GetDynOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get dyn o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetDynOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get dyn o auth2 client params -func (o *GetDynOAuth2ClientParams) WithTimeout(timeout time.Duration) *GetDynOAuth2ClientParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get dyn o auth2 client params -func (o *GetDynOAuth2ClientParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get dyn o auth2 client params -func (o *GetDynOAuth2ClientParams) WithContext(ctx context.Context) *GetDynOAuth2ClientParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get dyn o auth2 client params -func (o *GetDynOAuth2ClientParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get dyn o auth2 client params -func (o *GetDynOAuth2ClientParams) WithHTTPClient(client *http.Client) *GetDynOAuth2ClientParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get dyn o auth2 client params -func (o *GetDynOAuth2ClientParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get dyn o auth2 client params -func (o *GetDynOAuth2ClientParams) WithID(id string) *GetDynOAuth2ClientParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get dyn o auth2 client params -func (o *GetDynOAuth2ClientParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *GetDynOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/get_dyn_o_auth2_client_responses.go b/internal/httpclient/client/public/get_dyn_o_auth2_client_responses.go deleted file mode 100644 index d081e09d1a0..00000000000 --- a/internal/httpclient/client/public/get_dyn_o_auth2_client_responses.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// GetDynOAuth2ClientReader is a Reader for the GetDynOAuth2Client structure. -type GetDynOAuth2ClientReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetDynOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetDynOAuth2ClientOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetDynOAuth2ClientUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetDynOAuth2ClientInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetDynOAuth2ClientOK creates a GetDynOAuth2ClientOK with default headers values -func NewGetDynOAuth2ClientOK() *GetDynOAuth2ClientOK { - return &GetDynOAuth2ClientOK{} -} - -/* GetDynOAuth2ClientOK describes a response with status code 200, with default header values. - -oAuth2Client -*/ -type GetDynOAuth2ClientOK struct { - Payload *models.OAuth2Client -} - -func (o *GetDynOAuth2ClientOK) Error() string { - return fmt.Sprintf("[GET /dyn-clients/{id}][%d] getDynOAuth2ClientOK %+v", 200, o.Payload) -} -func (o *GetDynOAuth2ClientOK) GetPayload() *models.OAuth2Client { - return o.Payload -} - -func (o *GetDynOAuth2ClientOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OAuth2Client) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetDynOAuth2ClientUnauthorized creates a GetDynOAuth2ClientUnauthorized with default headers values -func NewGetDynOAuth2ClientUnauthorized() *GetDynOAuth2ClientUnauthorized { - return &GetDynOAuth2ClientUnauthorized{} -} - -/* GetDynOAuth2ClientUnauthorized describes a response with status code 401, with default header values. - -genericError -*/ -type GetDynOAuth2ClientUnauthorized struct { - Payload *models.GenericError -} - -func (o *GetDynOAuth2ClientUnauthorized) Error() string { - return fmt.Sprintf("[GET /dyn-clients/{id}][%d] getDynOAuth2ClientUnauthorized %+v", 401, o.Payload) -} -func (o *GetDynOAuth2ClientUnauthorized) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *GetDynOAuth2ClientUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetDynOAuth2ClientInternalServerError creates a GetDynOAuth2ClientInternalServerError with default headers values -func NewGetDynOAuth2ClientInternalServerError() *GetDynOAuth2ClientInternalServerError { - return &GetDynOAuth2ClientInternalServerError{} -} - -/* GetDynOAuth2ClientInternalServerError describes a response with status code 500, with default header values. - -genericError -*/ -type GetDynOAuth2ClientInternalServerError struct { - Payload *models.GenericError -} - -func (o *GetDynOAuth2ClientInternalServerError) Error() string { - return fmt.Sprintf("[GET /dyn-clients/{id}][%d] getDynOAuth2ClientInternalServerError %+v", 500, o.Payload) -} -func (o *GetDynOAuth2ClientInternalServerError) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *GetDynOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/get_o_auth2_client_public_parameters.go b/internal/httpclient/client/public/get_o_auth2_client_public_parameters.go new file mode 100644 index 00000000000..06a4105c46b --- /dev/null +++ b/internal/httpclient/client/public/get_o_auth2_client_public_parameters.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetOAuth2ClientPublicParams creates a new GetOAuth2ClientPublicParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetOAuth2ClientPublicParams() *GetOAuth2ClientPublicParams { + return &GetOAuth2ClientPublicParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetOAuth2ClientPublicParamsWithTimeout creates a new GetOAuth2ClientPublicParams object +// with the ability to set a timeout on a request. +func NewGetOAuth2ClientPublicParamsWithTimeout(timeout time.Duration) *GetOAuth2ClientPublicParams { + return &GetOAuth2ClientPublicParams{ + timeout: timeout, + } +} + +// NewGetOAuth2ClientPublicParamsWithContext creates a new GetOAuth2ClientPublicParams object +// with the ability to set a context for a request. +func NewGetOAuth2ClientPublicParamsWithContext(ctx context.Context) *GetOAuth2ClientPublicParams { + return &GetOAuth2ClientPublicParams{ + Context: ctx, + } +} + +// NewGetOAuth2ClientPublicParamsWithHTTPClient creates a new GetOAuth2ClientPublicParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetOAuth2ClientPublicParamsWithHTTPClient(client *http.Client) *GetOAuth2ClientPublicParams { + return &GetOAuth2ClientPublicParams{ + HTTPClient: client, + } +} + +/* GetOAuth2ClientPublicParams contains all the parameters to send to the API endpoint + for the get o auth2 client public operation. + + Typically these are written to a http.Request. +*/ +type GetOAuth2ClientPublicParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get o auth2 client public params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOAuth2ClientPublicParams) WithDefaults() *GetOAuth2ClientPublicParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get o auth2 client public params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOAuth2ClientPublicParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get o auth2 client public params +func (o *GetOAuth2ClientPublicParams) WithTimeout(timeout time.Duration) *GetOAuth2ClientPublicParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get o auth2 client public params +func (o *GetOAuth2ClientPublicParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get o auth2 client public params +func (o *GetOAuth2ClientPublicParams) WithContext(ctx context.Context) *GetOAuth2ClientPublicParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get o auth2 client public params +func (o *GetOAuth2ClientPublicParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get o auth2 client public params +func (o *GetOAuth2ClientPublicParams) WithHTTPClient(client *http.Client) *GetOAuth2ClientPublicParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get o auth2 client public params +func (o *GetOAuth2ClientPublicParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetOAuth2ClientPublicParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/get_o_auth2_client_public_responses.go b/internal/httpclient/client/public/get_o_auth2_client_public_responses.go new file mode 100644 index 00000000000..00993a7b47d --- /dev/null +++ b/internal/httpclient/client/public/get_o_auth2_client_public_responses.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// GetOAuth2ClientPublicReader is a Reader for the GetOAuth2ClientPublic structure. +type GetOAuth2ClientPublicReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOAuth2ClientPublicReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOAuth2ClientPublicOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetOAuth2ClientPublicUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetOAuth2ClientPublicInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetOAuth2ClientPublicOK creates a GetOAuth2ClientPublicOK with default headers values +func NewGetOAuth2ClientPublicOK() *GetOAuth2ClientPublicOK { + return &GetOAuth2ClientPublicOK{} +} + +/* GetOAuth2ClientPublicOK describes a response with status code 200, with default header values. + +oAuth2Client +*/ +type GetOAuth2ClientPublicOK struct { + Payload *models.OAuth2Client +} + +func (o *GetOAuth2ClientPublicOK) Error() string { + return fmt.Sprintf("[GET /connect/register][%d] getOAuth2ClientPublicOK %+v", 200, o.Payload) +} +func (o *GetOAuth2ClientPublicOK) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *GetOAuth2ClientPublicOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOAuth2ClientPublicUnauthorized creates a GetOAuth2ClientPublicUnauthorized with default headers values +func NewGetOAuth2ClientPublicUnauthorized() *GetOAuth2ClientPublicUnauthorized { + return &GetOAuth2ClientPublicUnauthorized{} +} + +/* GetOAuth2ClientPublicUnauthorized describes a response with status code 401, with default header values. + +genericError +*/ +type GetOAuth2ClientPublicUnauthorized struct { + Payload *models.GenericError +} + +func (o *GetOAuth2ClientPublicUnauthorized) Error() string { + return fmt.Sprintf("[GET /connect/register][%d] getOAuth2ClientPublicUnauthorized %+v", 401, o.Payload) +} +func (o *GetOAuth2ClientPublicUnauthorized) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *GetOAuth2ClientPublicUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOAuth2ClientPublicInternalServerError creates a GetOAuth2ClientPublicInternalServerError with default headers values +func NewGetOAuth2ClientPublicInternalServerError() *GetOAuth2ClientPublicInternalServerError { + return &GetOAuth2ClientPublicInternalServerError{} +} + +/* GetOAuth2ClientPublicInternalServerError describes a response with status code 500, with default header values. + +genericError +*/ +type GetOAuth2ClientPublicInternalServerError struct { + Payload *models.GenericError +} + +func (o *GetOAuth2ClientPublicInternalServerError) Error() string { + return fmt.Sprintf("[GET /connect/register][%d] getOAuth2ClientPublicInternalServerError %+v", 500, o.Payload) +} +func (o *GetOAuth2ClientPublicInternalServerError) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *GetOAuth2ClientPublicInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/public_client.go b/internal/httpclient/client/public/public_client.go index ae001f72529..31a6c56117c 100644 --- a/internal/httpclient/client/public/public_client.go +++ b/internal/httpclient/client/public/public_client.go @@ -30,15 +30,15 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - CreateDynOAuth2Client(params *CreateDynOAuth2ClientParams, opts ...ClientOption) (*CreateDynOAuth2ClientCreated, error) + CreateOAuth2ClientPublic(params *CreateOAuth2ClientPublicParams, opts ...ClientOption) (*CreateOAuth2ClientPublicCreated, error) - DeleteDynOAuth2Client(params *DeleteDynOAuth2ClientParams, opts ...ClientOption) (*DeleteDynOAuth2ClientNoContent, error) + DeleteOAuth2ClientPublic(params *DeleteOAuth2ClientPublicParams, opts ...ClientOption) (*DeleteOAuth2ClientPublicNoContent, error) DisconnectUser(params *DisconnectUserParams, opts ...ClientOption) error DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams, opts ...ClientOption) (*DiscoverOpenIDConfigurationOK, error) - GetDynOAuth2Client(params *GetDynOAuth2ClientParams, opts ...ClientOption) (*GetDynOAuth2ClientOK, error) + GetOAuth2ClientPublic(params *GetOAuth2ClientPublicParams, opts ...ClientOption) (*GetOAuth2ClientPublicOK, error) IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOption) (*IsInstanceReadyOK, error) @@ -48,7 +48,7 @@ type ClientService interface { RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeOAuth2TokenOK, error) - UpdateDynOAuth2Client(params *UpdateDynOAuth2ClientParams, opts ...ClientOption) (*UpdateDynOAuth2ClientOK, error) + UpdateOAuth2ClientPublic(params *UpdateOAuth2ClientPublicParams, opts ...ClientOption) (*UpdateOAuth2ClientPublicOK, error) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UserinfoOK, error) @@ -58,26 +58,26 @@ type ClientService interface { } /* - CreateDynOAuth2Client creates an o auth 2 0 client + CreateOAuth2ClientPublic creates an o auth 2 0 client - Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. + Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. */ -func (a *Client) CreateDynOAuth2Client(params *CreateDynOAuth2ClientParams, opts ...ClientOption) (*CreateDynOAuth2ClientCreated, error) { +func (a *Client) CreateOAuth2ClientPublic(params *CreateOAuth2ClientPublicParams, opts ...ClientOption) (*CreateOAuth2ClientPublicCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewCreateDynOAuth2ClientParams() + params = NewCreateOAuth2ClientPublicParams() } op := &runtime.ClientOperation{ - ID: "createDynOAuth2Client", + ID: "createOAuth2ClientPublic", Method: "POST", - PathPattern: "/dyn-clients", + PathPattern: "/connect/register", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &CreateDynOAuth2ClientReader{formats: a.formats}, + Reader: &CreateOAuth2ClientPublicReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -89,37 +89,37 @@ func (a *Client) CreateDynOAuth2Client(params *CreateDynOAuth2ClientParams, opts if err != nil { return nil, err } - success, ok := result.(*CreateDynOAuth2ClientCreated) + success, ok := result.(*CreateOAuth2ClientPublicCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createDynOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for createOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - DeleteDynOAuth2Client deletes an o auth 2 0 client + DeleteOAuth2ClientPublic deletes an o auth 2 0 client Delete an existing OAuth 2.0 Client by its ID. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. */ -func (a *Client) DeleteDynOAuth2Client(params *DeleteDynOAuth2ClientParams, opts ...ClientOption) (*DeleteDynOAuth2ClientNoContent, error) { +func (a *Client) DeleteOAuth2ClientPublic(params *DeleteOAuth2ClientPublicParams, opts ...ClientOption) (*DeleteOAuth2ClientPublicNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDeleteDynOAuth2ClientParams() + params = NewDeleteOAuth2ClientPublicParams() } op := &runtime.ClientOperation{ - ID: "deleteDynOAuth2Client", + ID: "deleteOAuth2ClientPublic", Method: "DELETE", - PathPattern: "/dyn-clients/{id}", + PathPattern: "/connect/register", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &DeleteDynOAuth2ClientReader{formats: a.formats}, + Reader: &DeleteOAuth2ClientPublicReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -131,13 +131,13 @@ func (a *Client) DeleteDynOAuth2Client(params *DeleteDynOAuth2ClientParams, opts if err != nil { return nil, err } - success, ok := result.(*DeleteDynOAuth2ClientNoContent) + success, ok := result.(*DeleteOAuth2ClientPublicNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteDynOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for deleteOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -223,26 +223,26 @@ func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfiguration } /* - GetDynOAuth2Client gets an o auth 2 0 client + GetOAuth2ClientPublic gets an o auth 2 0 client Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. */ -func (a *Client) GetDynOAuth2Client(params *GetDynOAuth2ClientParams, opts ...ClientOption) (*GetDynOAuth2ClientOK, error) { +func (a *Client) GetOAuth2ClientPublic(params *GetOAuth2ClientPublicParams, opts ...ClientOption) (*GetOAuth2ClientPublicOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewGetDynOAuth2ClientParams() + params = NewGetOAuth2ClientPublicParams() } op := &runtime.ClientOperation{ - ID: "getDynOAuth2Client", + ID: "getOAuth2ClientPublic", Method: "GET", - PathPattern: "/dyn-clients/{id}", + PathPattern: "/connect/register", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &GetDynOAuth2ClientReader{formats: a.formats}, + Reader: &GetOAuth2ClientPublicReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -254,13 +254,13 @@ func (a *Client) GetDynOAuth2Client(params *GetDynOAuth2ClientParams, opts ...Cl if err != nil { return nil, err } - success, ok := result.(*GetDynOAuth2ClientOK) + success, ok := result.(*GetOAuth2ClientPublicOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getDynOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for getOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -440,26 +440,26 @@ func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo run } /* - UpdateDynOAuth2Client updates an o auth 2 0 client + UpdateOAuth2ClientPublic updates an o auth 2 0 client Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. */ -func (a *Client) UpdateDynOAuth2Client(params *UpdateDynOAuth2ClientParams, opts ...ClientOption) (*UpdateDynOAuth2ClientOK, error) { +func (a *Client) UpdateOAuth2ClientPublic(params *UpdateOAuth2ClientPublicParams, opts ...ClientOption) (*UpdateOAuth2ClientPublicOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewUpdateDynOAuth2ClientParams() + params = NewUpdateOAuth2ClientPublicParams() } op := &runtime.ClientOperation{ - ID: "updateDynOAuth2Client", + ID: "updateOAuth2ClientPublic", Method: "PUT", - PathPattern: "/dyn-clients/{id}", + PathPattern: "/connect/register", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &UpdateDynOAuth2ClientReader{formats: a.formats}, + Reader: &UpdateOAuth2ClientPublicReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -471,13 +471,13 @@ func (a *Client) UpdateDynOAuth2Client(params *UpdateDynOAuth2ClientParams, opts if err != nil { return nil, err } - success, ok := result.(*UpdateDynOAuth2ClientOK) + success, ok := result.(*UpdateOAuth2ClientPublicOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateDynOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for updateOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/internal/httpclient/client/public/update_dyn_o_auth2_client_parameters.go b/internal/httpclient/client/public/update_dyn_o_auth2_client_parameters.go deleted file mode 100644 index b9ce01f93a0..00000000000 --- a/internal/httpclient/client/public/update_dyn_o_auth2_client_parameters.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// NewUpdateDynOAuth2ClientParams creates a new UpdateDynOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateDynOAuth2ClientParams() *UpdateDynOAuth2ClientParams { - return &UpdateDynOAuth2ClientParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateDynOAuth2ClientParamsWithTimeout creates a new UpdateDynOAuth2ClientParams object -// with the ability to set a timeout on a request. -func NewUpdateDynOAuth2ClientParamsWithTimeout(timeout time.Duration) *UpdateDynOAuth2ClientParams { - return &UpdateDynOAuth2ClientParams{ - timeout: timeout, - } -} - -// NewUpdateDynOAuth2ClientParamsWithContext creates a new UpdateDynOAuth2ClientParams object -// with the ability to set a context for a request. -func NewUpdateDynOAuth2ClientParamsWithContext(ctx context.Context) *UpdateDynOAuth2ClientParams { - return &UpdateDynOAuth2ClientParams{ - Context: ctx, - } -} - -// NewUpdateDynOAuth2ClientParamsWithHTTPClient creates a new UpdateDynOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateDynOAuth2ClientParamsWithHTTPClient(client *http.Client) *UpdateDynOAuth2ClientParams { - return &UpdateDynOAuth2ClientParams{ - HTTPClient: client, - } -} - -/* UpdateDynOAuth2ClientParams contains all the parameters to send to the API endpoint - for the update dyn o auth2 client operation. - - Typically these are written to a http.Request. -*/ -type UpdateDynOAuth2ClientParams struct { - - // Body. - Body *models.OAuth2Client - - // ID. - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update dyn o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateDynOAuth2ClientParams) WithDefaults() *UpdateDynOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update dyn o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateDynOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update dyn o auth2 client params -func (o *UpdateDynOAuth2ClientParams) WithTimeout(timeout time.Duration) *UpdateDynOAuth2ClientParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update dyn o auth2 client params -func (o *UpdateDynOAuth2ClientParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update dyn o auth2 client params -func (o *UpdateDynOAuth2ClientParams) WithContext(ctx context.Context) *UpdateDynOAuth2ClientParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update dyn o auth2 client params -func (o *UpdateDynOAuth2ClientParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update dyn o auth2 client params -func (o *UpdateDynOAuth2ClientParams) WithHTTPClient(client *http.Client) *UpdateDynOAuth2ClientParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update dyn o auth2 client params -func (o *UpdateDynOAuth2ClientParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the update dyn o auth2 client params -func (o *UpdateDynOAuth2ClientParams) WithBody(body *models.OAuth2Client) *UpdateDynOAuth2ClientParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update dyn o auth2 client params -func (o *UpdateDynOAuth2ClientParams) SetBody(body *models.OAuth2Client) { - o.Body = body -} - -// WithID adds the id to the update dyn o auth2 client params -func (o *UpdateDynOAuth2ClientParams) WithID(id string) *UpdateDynOAuth2ClientParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update dyn o auth2 client params -func (o *UpdateDynOAuth2ClientParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateDynOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/update_dyn_o_auth2_client_responses.go b/internal/httpclient/client/public/update_dyn_o_auth2_client_responses.go deleted file mode 100644 index 7cf7c6fafc9..00000000000 --- a/internal/httpclient/client/public/update_dyn_o_auth2_client_responses.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// UpdateDynOAuth2ClientReader is a Reader for the UpdateDynOAuth2Client structure. -type UpdateDynOAuth2ClientReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateDynOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateDynOAuth2ClientOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewUpdateDynOAuth2ClientInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateDynOAuth2ClientOK creates a UpdateDynOAuth2ClientOK with default headers values -func NewUpdateDynOAuth2ClientOK() *UpdateDynOAuth2ClientOK { - return &UpdateDynOAuth2ClientOK{} -} - -/* UpdateDynOAuth2ClientOK describes a response with status code 200, with default header values. - -oAuth2Client -*/ -type UpdateDynOAuth2ClientOK struct { - Payload *models.OAuth2Client -} - -func (o *UpdateDynOAuth2ClientOK) Error() string { - return fmt.Sprintf("[PUT /dyn-clients/{id}][%d] updateDynOAuth2ClientOK %+v", 200, o.Payload) -} -func (o *UpdateDynOAuth2ClientOK) GetPayload() *models.OAuth2Client { - return o.Payload -} - -func (o *UpdateDynOAuth2ClientOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OAuth2Client) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateDynOAuth2ClientInternalServerError creates a UpdateDynOAuth2ClientInternalServerError with default headers values -func NewUpdateDynOAuth2ClientInternalServerError() *UpdateDynOAuth2ClientInternalServerError { - return &UpdateDynOAuth2ClientInternalServerError{} -} - -/* UpdateDynOAuth2ClientInternalServerError describes a response with status code 500, with default header values. - -genericError -*/ -type UpdateDynOAuth2ClientInternalServerError struct { - Payload *models.GenericError -} - -func (o *UpdateDynOAuth2ClientInternalServerError) Error() string { - return fmt.Sprintf("[PUT /dyn-clients/{id}][%d] updateDynOAuth2ClientInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateDynOAuth2ClientInternalServerError) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *UpdateDynOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/update_o_auth2_client_public_parameters.go b/internal/httpclient/client/public/update_o_auth2_client_public_parameters.go new file mode 100644 index 00000000000..04a8287b8e6 --- /dev/null +++ b/internal/httpclient/client/public/update_o_auth2_client_public_parameters.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateOAuth2ClientPublicParams creates a new UpdateOAuth2ClientPublicParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateOAuth2ClientPublicParams() *UpdateOAuth2ClientPublicParams { + return &UpdateOAuth2ClientPublicParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateOAuth2ClientPublicParamsWithTimeout creates a new UpdateOAuth2ClientPublicParams object +// with the ability to set a timeout on a request. +func NewUpdateOAuth2ClientPublicParamsWithTimeout(timeout time.Duration) *UpdateOAuth2ClientPublicParams { + return &UpdateOAuth2ClientPublicParams{ + timeout: timeout, + } +} + +// NewUpdateOAuth2ClientPublicParamsWithContext creates a new UpdateOAuth2ClientPublicParams object +// with the ability to set a context for a request. +func NewUpdateOAuth2ClientPublicParamsWithContext(ctx context.Context) *UpdateOAuth2ClientPublicParams { + return &UpdateOAuth2ClientPublicParams{ + Context: ctx, + } +} + +// NewUpdateOAuth2ClientPublicParamsWithHTTPClient creates a new UpdateOAuth2ClientPublicParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateOAuth2ClientPublicParamsWithHTTPClient(client *http.Client) *UpdateOAuth2ClientPublicParams { + return &UpdateOAuth2ClientPublicParams{ + HTTPClient: client, + } +} + +/* UpdateOAuth2ClientPublicParams contains all the parameters to send to the API endpoint + for the update o auth2 client public operation. + + Typically these are written to a http.Request. +*/ +type UpdateOAuth2ClientPublicParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update o auth2 client public params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateOAuth2ClientPublicParams) WithDefaults() *UpdateOAuth2ClientPublicParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update o auth2 client public params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateOAuth2ClientPublicParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update o auth2 client public params +func (o *UpdateOAuth2ClientPublicParams) WithTimeout(timeout time.Duration) *UpdateOAuth2ClientPublicParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update o auth2 client public params +func (o *UpdateOAuth2ClientPublicParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update o auth2 client public params +func (o *UpdateOAuth2ClientPublicParams) WithContext(ctx context.Context) *UpdateOAuth2ClientPublicParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update o auth2 client public params +func (o *UpdateOAuth2ClientPublicParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update o auth2 client public params +func (o *UpdateOAuth2ClientPublicParams) WithHTTPClient(client *http.Client) *UpdateOAuth2ClientPublicParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update o auth2 client public params +func (o *UpdateOAuth2ClientPublicParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateOAuth2ClientPublicParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/update_o_auth2_client_public_responses.go b/internal/httpclient/client/public/update_o_auth2_client_public_responses.go new file mode 100644 index 00000000000..822c0c1cfd4 --- /dev/null +++ b/internal/httpclient/client/public/update_o_auth2_client_public_responses.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// UpdateOAuth2ClientPublicReader is a Reader for the UpdateOAuth2ClientPublic structure. +type UpdateOAuth2ClientPublicReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateOAuth2ClientPublicReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateOAuth2ClientPublicOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewUpdateOAuth2ClientPublicInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateOAuth2ClientPublicOK creates a UpdateOAuth2ClientPublicOK with default headers values +func NewUpdateOAuth2ClientPublicOK() *UpdateOAuth2ClientPublicOK { + return &UpdateOAuth2ClientPublicOK{} +} + +/* UpdateOAuth2ClientPublicOK describes a response with status code 200, with default header values. + +oAuth2Client +*/ +type UpdateOAuth2ClientPublicOK struct { + Payload *models.OAuth2Client +} + +func (o *UpdateOAuth2ClientPublicOK) Error() string { + return fmt.Sprintf("[PUT /connect/register][%d] updateOAuth2ClientPublicOK %+v", 200, o.Payload) +} +func (o *UpdateOAuth2ClientPublicOK) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *UpdateOAuth2ClientPublicOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateOAuth2ClientPublicInternalServerError creates a UpdateOAuth2ClientPublicInternalServerError with default headers values +func NewUpdateOAuth2ClientPublicInternalServerError() *UpdateOAuth2ClientPublicInternalServerError { + return &UpdateOAuth2ClientPublicInternalServerError{} +} + +/* UpdateOAuth2ClientPublicInternalServerError describes a response with status code 500, with default header values. + +genericError +*/ +type UpdateOAuth2ClientPublicInternalServerError struct { + Payload *models.GenericError +} + +func (o *UpdateOAuth2ClientPublicInternalServerError) Error() string { + return fmt.Sprintf("[PUT /connect/register][%d] updateOAuth2ClientPublicInternalServerError %+v", 500, o.Payload) +} +func (o *UpdateOAuth2ClientPublicInternalServerError) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *UpdateOAuth2ClientPublicInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/spec/api.json b/spec/api.json index 22f32ba1086..e9e63bdaa8d 100755 --- a/spec/api.json +++ b/spec/api.json @@ -385,9 +385,9 @@ } } }, - "/dyn-clients": { - "post": { - "description": "Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "/connect/register": { + "get": { + "description": "Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected.", "consumes": [ "application/json" ], @@ -401,22 +401,16 @@ "tags": [ "public" ], - "summary": "Create an OAuth 2.0 Client", - "operationId": "createDynOAuth2Client", + "summary": "Get an OAuth 2.0 Client.", + "operationId": "getOAuth2ClientPublic", "responses": { - "201": { + "200": { "description": "oAuth2Client", "schema": { "$ref": "#/definitions/oAuth2Client" } }, - "400": { - "description": "genericError", - "schema": { - "$ref": "#/definitions/genericError" - } - }, - "409": { + "401": { "description": "genericError", "schema": { "$ref": "#/definitions/genericError" @@ -429,11 +423,9 @@ } } } - } - }, - "/dyn-clients/{id}": { - "get": { - "description": "Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + }, + "put": { + "description": "Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected.", "consumes": [ "application/json" ], @@ -447,17 +439,8 @@ "tags": [ "public" ], - "summary": "Get an OAuth 2.0 Client.", - "operationId": "getDynOAuth2Client", - "parameters": [ - { - "type": "string", - "description": "The id of the OAuth 2.0 Client.", - "name": "id", - "in": "path", - "required": true - } - ], + "summary": "Update an OAuth 2.0 Client", + "operationId": "updateOAuth2ClientPublic", "responses": { "200": { "description": "oAuth2Client", @@ -465,12 +448,6 @@ "$ref": "#/definitions/oAuth2Client" } }, - "401": { - "description": "genericError", - "schema": { - "$ref": "#/definitions/genericError" - } - }, "500": { "description": "genericError", "schema": { @@ -479,8 +456,8 @@ } } }, - "put": { - "description": "Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "post": { + "description": "Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well.", "consumes": [ "application/json" ], @@ -494,31 +471,27 @@ "tags": [ "public" ], - "summary": "Update an OAuth 2.0 Client", - "operationId": "updateDynOAuth2Client", - "parameters": [ - { - "type": "string", - "name": "id", - "in": "path", - "required": true - }, - { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/oAuth2Client" - } - } - ], + "summary": "Create an OAuth 2.0 Client", + "operationId": "createOAuth2ClientPublic", "responses": { - "200": { + "201": { "description": "oAuth2Client", "schema": { "$ref": "#/definitions/oAuth2Client" } }, + "400": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + }, + "409": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + }, "500": { "description": "genericError", "schema": { @@ -528,7 +501,7 @@ } }, "delete": { - "description": "Delete an existing OAuth 2.0 Client by its ID.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "description": "Delete an existing OAuth 2.0 Client by its ID.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected.", "consumes": [ "application/json" ], @@ -543,16 +516,7 @@ "public" ], "summary": "Deletes an OAuth 2.0 Client", - "operationId": "deleteDynOAuth2Client", - "parameters": [ - { - "type": "string", - "description": "The id of the OAuth 2.0 Client.", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "deleteOAuth2ClientPublic", "responses": { "204": { "description": "Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is\ntypically 201." diff --git a/spec/config.json b/spec/config.json index 45ad3e4ee40..de466997b79 100644 --- a/spec/config.json +++ b/spec/config.json @@ -764,6 +764,15 @@ "$ref": "#/definitions/duration" } ] + }, + "dynamic_client_registration_token": { + "description": "Configures how long dynamic client registration tokens are valid.", + "default": "1h", + "allOf": [ + { + "$ref": "#/definitions/duration" + } + ] } } }, From 30bfa8ab2a86dbb1f654154e503853bee1075c11 Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Tue, 22 Jun 2021 16:04:18 +0200 Subject: [PATCH 16/41] run prettier --- .../openid/dynamic_client_registration.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/cypress/integration/openid/dynamic_client_registration.js b/cypress/integration/openid/dynamic_client_registration.js index aa2f294a7f6..13360733b4e 100644 --- a/cypress/integration/openid/dynamic_client_registration.js +++ b/cypress/integration/openid/dynamic_client_registration.js @@ -1,7 +1,6 @@ import { prng } from '../../helpers' describe('The Clients Pubic Interface', function () { - it('should return same client_secret given in request for newly created clients with client_secret specified', function () { cy.request({ method: 'POST', @@ -25,7 +24,7 @@ describe('The Clients Pubic Interface', function () { method: 'GET', url: Cypress.env('public_url') + '/connect/register?client_id=clientid', headers: { - 'Authorization' : 'Basic Y2xpZW50aWQ6c2VjcmV0' + Authorization: 'Basic Y2xpZW50aWQ6c2VjcmV0' } }).then((response) => { console.log(response.body) @@ -37,8 +36,7 @@ describe('The Clients Pubic Interface', function () { cy.request({ method: 'GET', failOnStatusCode: false, - url: - Cypress.env('public_url') + '/connect/register?client_id=clientid' + url: Cypress.env('public_url') + '/connect/register?client_id=clientid' }).then((response) => { expect(response.status).to.eq(401) }) @@ -49,7 +47,7 @@ describe('The Clients Pubic Interface', function () { method: 'PUT', url: Cypress.env('public_url') + '/connect/register?client_id=clientid', headers: { - 'Authorization' : 'Basic Y2xpZW50aWQ6c2VjcmV0' + Authorization: 'Basic Y2xpZW50aWQ6c2VjcmV0' }, body: { client_id: 'clientid', @@ -84,8 +82,7 @@ describe('The Clients Pubic Interface', function () { cy.request({ method: 'DELETE', failOnStatusCode: false, - url: - Cypress.env('public_url') + '/connect/register?client_id=clientid' + url: Cypress.env('public_url') + '/connect/register?client_id=clientid' }).then((response) => { expect(response.status).to.eq(401) }) @@ -97,7 +94,7 @@ describe('The Clients Pubic Interface', function () { failOnStatusCode: false, url: Cypress.env('public_url') + '/connect/register?client_id=clientid', headers: { - 'Authorization' : 'Basic Y2xpZW50aWQ6c2VjcmV0' + Authorization: 'Basic Y2xpZW50aWQ6c2VjcmV0' } }).then((response) => { expect(response.status).to.eq(204) From 86ebb7d086e51ea84d37acb7c9fbb157e729d2cc Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Tue, 22 Jun 2021 16:15:09 +0200 Subject: [PATCH 17/41] fix golang-ci violations --- client/handler.go | 5 ++++- driver/config/provider.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/handler.go b/client/handler.go index 888adec6f18..d035158d54b 100644 --- a/client/handler.go +++ b/client/handler.go @@ -142,6 +142,10 @@ func (h *Handler) CreateDynamicRegistration(w http.ResponseWriter, r *http.Reque } kid, err := h.r.OpenIDJWTStrategy().GetPublicKeyID(r.Context()) + if err != nil { + h.r.Writer().WriteError(w, r, err) + return + } token, _, err := h.r.OpenIDJWTStrategy().Generate(r.Context(), jwtgo.MapClaims{ "iss": h.r.ClientValidator().conf.IssuerURL().String(), "exp": time.Now().Add(h.r.ClientValidator().conf.DynamicClientRegistrationTokenLifespan()).Unix(), @@ -600,7 +604,6 @@ func (h *Handler) validateDynClientRegistrationAuthorization(r *http.Request, c default: return herodot.ErrUnauthorized.WithReason("Token does not contains a valid sid") } - return herodot.ErrUnauthorized.WithReason("Unexpected error") } func getBasicAuth(req *http.Request) string { diff --git a/driver/config/provider.go b/driver/config/provider.go index 00b91923868..8586fc69a03 100644 --- a/driver/config/provider.go +++ b/driver/config/provider.go @@ -45,7 +45,7 @@ const ( KeyRefreshTokenLifespan = "ttl.refresh_token" // #nosec G101 KeyIDTokenLifespan = "ttl.id_token" // #nosec G101 KeyAuthCodeLifespan = "ttl.auth_code" - KeyDynamicClientRegistrationTokenLifespan = "ttl.dynamic_client_registration_token" + KeyDynamicClientRegistrationTokenLifespan = "ttl.dynamic_client_registration_token" // #nosec G101 KeyScopeStrategy = "strategies.scope" KeyGetCookieSecrets = "secrets.cookie" KeyGetSystemSecret = "secrets.system" From b5f99918e57fd5c7b85827b04c7858d5039700b8 Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Tue, 29 Jun 2021 13:17:25 +0200 Subject: [PATCH 18/41] Dynamic client registration only with basisc auth --- client/handler.go | 91 ++++--------------- .../openid/dynamic_client_registration.js | 1 - docs/docs/reference/configuration.md | 14 --- driver/config/provider.go | 5 - driver/config/provider_test.go | 1 - internal/.hydra.yaml | 1 - internal/config/config.yaml | 2 - quickstart-postgres.yml | 23 ++--- spec/config.json | 9 -- 9 files changed, 26 insertions(+), 121 deletions(-) diff --git a/client/handler.go b/client/handler.go index d035158d54b..2c5b9783e4d 100644 --- a/client/handler.go +++ b/client/handler.go @@ -29,13 +29,6 @@ import ( "strings" "time" - "github.com/ory/fosite" - - "github.com/pborman/uuid" - - "github.com/ory/fosite/token/jwt" - jwtgo "github.com/ory/fosite/token/jwt" - "github.com/ory/x/errorsx" "github.com/ory/herodot" @@ -141,41 +134,7 @@ func (h *Handler) CreateDynamicRegistration(w http.ResponseWriter, r *http.Reque return } - kid, err := h.r.OpenIDJWTStrategy().GetPublicKeyID(r.Context()) - if err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - token, _, err := h.r.OpenIDJWTStrategy().Generate(r.Context(), jwtgo.MapClaims{ - "iss": h.r.ClientValidator().conf.IssuerURL().String(), - "exp": time.Now().Add(h.r.ClientValidator().conf.DynamicClientRegistrationTokenLifespan()).Unix(), - "aud": []string{c.OutfacingID}, - "iat": time.Now().UTC().Unix(), - "jti": uuid.New(), - "sid": c.GetID(), - }, &jwt.Headers{ - Extra: map[string]interface{}{"kid": kid}, - }) - if err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - - b, err := json.Marshal(c) - if err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - - var resp map[string]interface{} - err = json.Unmarshal(b, &resp) - if err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - resp["registration_access_token"] = token - - h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &resp) + h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &c) } func (h *Handler) create(w http.ResponseWriter, r *http.Request, f func(*Client) error) (*Client, error) { @@ -566,44 +525,26 @@ func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Reque func (h *Handler) validateDynClientRegistrationAuthorization(r *http.Request, c Client) error { - // Check basic auth - if basicAuth := getBasicAuth(r); basicAuth != "" { - sDec, err := base64.StdEncoding.DecodeString(basicAuth) - if err != nil { - return herodot.ErrUnauthorized.WithReason("Invalid authorization") - } - split := strings.SplitN(string(sDec), ":", 2) - if len(split) != 2 { - return herodot.ErrUnauthorized.WithReason("Invalid authorization") - } - if c.OutfacingID != split[0] { - return herodot.ErrUnauthorized.WithReason("Invalid authorization") - } - _, err = h.r.ClientManager().Authenticate(r.Context(), split[0], []byte(split[1])) - if err != nil { - return herodot.ErrUnauthorized.WithReason("Invalid authorization") - } - return nil + basicAuth := getBasicAuth(r) + if basicAuth == "" { + return herodot.ErrUnauthorized.WithReason("Invalid authorization") } - - // Check check token - t, err := h.r.OpenIDJWTStrategy().Decode(r.Context(), fosite.AccessTokenFromRequest(r)) + sDec, err := base64.StdEncoding.DecodeString(basicAuth) if err != nil { - return herodot.ErrUnauthorized.WithReason("Error parsing access token") + return herodot.ErrUnauthorized.WithReason("Invalid authorization") } - - if !t.Valid() { - return herodot.ErrUnauthorized.WithReason("Invalid token") + split := strings.SplitN(string(sDec), ":", 2) + if len(split) != 2 { + return herodot.ErrUnauthorized.WithReason("Invalid authorization") } - switch sid := t.Claims["sid"].(type) { - case string: - if c.OutfacingID != sid { - return herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") - } - return nil - default: - return herodot.ErrUnauthorized.WithReason("Token does not contains a valid sid") + if c.OutfacingID != split[0] { + return herodot.ErrUnauthorized.WithReason("Invalid authorization") + } + _, err = h.r.ClientManager().Authenticate(r.Context(), split[0], []byte(split[1])) + if err != nil { + return herodot.ErrUnauthorized.WithReason("Invalid authorization") } + return nil } func getBasicAuth(req *http.Request) string { diff --git a/cypress/integration/openid/dynamic_client_registration.js b/cypress/integration/openid/dynamic_client_registration.js index 13360733b4e..86bf1c49c10 100644 --- a/cypress/integration/openid/dynamic_client_registration.js +++ b/cypress/integration/openid/dynamic_client_registration.js @@ -15,7 +15,6 @@ describe('The Clients Pubic Interface', function () { }).then((response) => { console.log(response.body) expect(response.body.client_secret).to.equal('secret') - expect(response.body.registration_access_token).to.not.be.empty }) }) diff --git a/docs/docs/reference/configuration.md b/docs/docs/reference/configuration.md index 263a75453e6..56d7cdb149b 100644 --- a/docs/docs/reference/configuration.md +++ b/docs/docs/reference/configuration.md @@ -1169,20 +1169,6 @@ ttl: # login_consent_request: 1h - ## dynamic_client_registration_token ## - # - # Configures how long a dynamic client registration are valid. - # - # Default value: 1h - # - # Set this value using environment variables on - # - Linux/macOS: - # $ export TTL_DYNAMIC_CLIENT_REGISTRATION_TOKEN= - # - Windows Command Line (CMD): - # > set TTL_DYNAMIC_CLIENT_REGISTRATION_TOKEN= - # - dynamic_client_registration_token: 1h - ## oauth2 ## # oauth2: diff --git a/driver/config/provider.go b/driver/config/provider.go index 8586fc69a03..31230954a5d 100644 --- a/driver/config/provider.go +++ b/driver/config/provider.go @@ -45,7 +45,6 @@ const ( KeyRefreshTokenLifespan = "ttl.refresh_token" // #nosec G101 KeyIDTokenLifespan = "ttl.id_token" // #nosec G101 KeyAuthCodeLifespan = "ttl.auth_code" - KeyDynamicClientRegistrationTokenLifespan = "ttl.dynamic_client_registration_token" // #nosec G101 KeyScopeStrategy = "strategies.scope" KeyGetCookieSecrets = "secrets.cookie" KeyGetSystemSecret = "secrets.system" @@ -251,10 +250,6 @@ func (p *Provider) AuthCodeLifespan() time.Duration { return p.p.DurationF(KeyAuthCodeLifespan, time.Minute*10) } -func (p *Provider) DynamicClientRegistrationTokenLifespan() time.Duration { - return p.p.DurationF(KeyDynamicClientRegistrationTokenLifespan, time.Hour) -} - func (p *Provider) ScopeStrategy() string { return p.p.String(KeyScopeStrategy) } diff --git a/driver/config/provider_test.go b/driver/config/provider_test.go index 1e9e58598af..b8f8a365d63 100644 --- a/driver/config/provider_test.go +++ b/driver/config/provider_test.go @@ -297,7 +297,6 @@ func TestViperProviderValidates(t *testing.T) { assert.Equal(t, 2*time.Hour, c.RefreshTokenLifespan()) assert.Equal(t, 2*time.Hour, c.IDTokenLifespan()) assert.Equal(t, 2*time.Hour, c.AuthCodeLifespan()) - assert.Equal(t, 2*time.Hour, c.DynamicClientRegistrationTokenLifespan()) // oauth2 assert.Equal(t, true, c.ShareOAuth2Debug()) diff --git a/internal/.hydra.yaml b/internal/.hydra.yaml index 0358fb35ee2..11f47550e99 100644 --- a/internal/.hydra.yaml +++ b/internal/.hydra.yaml @@ -110,7 +110,6 @@ ttl: refresh_token: 2h id_token: 2h auth_code: 2h - dynamic_client_registration_token: 2h oauth2: expose_internal_errors: true diff --git a/internal/config/config.yaml b/internal/config/config.yaml index e87d7f1e849..c0d8e3784de 100644 --- a/internal/config/config.yaml +++ b/internal/config/config.yaml @@ -370,8 +370,6 @@ ttl: id_token: 1h # configures how long auth codes are valid. Defaults to 10m. auth_code: 10m - # configures how long dynamic registration tokens are valid. Defaults to 1h. - dynamic_client_registration_token: 1h oauth2: # Set this to true if you want to share error debugging information with your OAuth 2.0 clients. diff --git a/quickstart-postgres.yml b/quickstart-postgres.yml index 0ea4dfd0f4b..40d42d2ab8d 100644 --- a/quickstart-postgres.yml +++ b/quickstart-postgres.yml @@ -13,17 +13,6 @@ version: '3.7' services: - - hydra-migrate: - image: oryd/hydra:v1.10.2 - environment: - - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 - - hydra: - image: oryd/hydra:v1.10.2 - environment: - - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 - postgresd: image: postgres:9.6 ports: @@ -32,5 +21,13 @@ services: - POSTGRES_USER=hydra - POSTGRES_PASSWORD=secret - POSTGRES_DB=hydra - networks: - - intranet + hydra-migrate: + image: oryd/hydra:v1.9.2 + environment: + - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 + - SECRETS_SYSTEM=11112222333344445555666677778888 + command: + migrate sql -e --yes + restart: on-failure + depends_on: + - postgresd diff --git a/spec/config.json b/spec/config.json index de466997b79..45ad3e4ee40 100644 --- a/spec/config.json +++ b/spec/config.json @@ -764,15 +764,6 @@ "$ref": "#/definitions/duration" } ] - }, - "dynamic_client_registration_token": { - "description": "Configures how long dynamic client registration tokens are valid.", - "default": "1h", - "allOf": [ - { - "$ref": "#/definitions/duration" - } - ] } } }, From 7c0bebe03fc9a411af03003cfaa5ca314341b2f8 Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Tue, 13 Jul 2021 13:18:35 +0200 Subject: [PATCH 19/41] Add unit test to handler.go --- client/handler.go | 8 +-- client/handler_test.go | 65 +++++++++++++++++++ .../openid/dynamic_client_registration.js | 4 +- quickstart-postgres.yml | 23 ++++--- 4 files changed, 83 insertions(+), 17 deletions(-) create mode 100644 client/handler_test.go diff --git a/client/handler.go b/client/handler.go index 2c5b9783e4d..825b8f4368d 100644 --- a/client/handler.go +++ b/client/handler.go @@ -302,7 +302,7 @@ func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Reque } c.OutfacingID = r.URL.Query().Get("client_id") - if err := h.validateDynClientRegistrationAuthorization(r, c); err != nil { + if err := h.ValidateDynClientRegistrationAuthorization(r, c); err != nil { h.r.Writer().WriteErrorCode(w, r, http.StatusUnauthorized, err) return } @@ -439,7 +439,7 @@ func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, return } - if err := h.validateDynClientRegistrationAuthorization(r, *c); err != nil { + if err := h.ValidateDynClientRegistrationAuthorization(r, *c); err != nil { h.r.Writer().WriteErrorCode(w, r, http.StatusUnauthorized, err) return } @@ -510,7 +510,7 @@ func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Reque return } - if err := h.validateDynClientRegistrationAuthorization(r, *c); err != nil { + if err := h.ValidateDynClientRegistrationAuthorization(r, *c); err != nil { h.r.Writer().WriteErrorCode(w, r, http.StatusUnauthorized, err) return } @@ -523,7 +523,7 @@ func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Reque w.WriteHeader(http.StatusNoContent) } -func (h *Handler) validateDynClientRegistrationAuthorization(r *http.Request, c Client) error { +func (h *Handler) ValidateDynClientRegistrationAuthorization(r *http.Request, c Client) error { basicAuth := getBasicAuth(r) if basicAuth == "" { diff --git a/client/handler_test.go b/client/handler_test.go new file mode 100644 index 00000000000..21cd7c41e54 --- /dev/null +++ b/client/handler_test.go @@ -0,0 +1,65 @@ +/* + * Copyright © 2015-2018 Javier Viera + * + * 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. + * + * @author Javier Viera + * @Copyright 2017-2018 Javier Viera + * @license Apache-2.0 + */ + +package client_test + +import ( + "net/http" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ory/x/urlx" + + "github.com/ory/hydra/client" + "github.com/ory/hydra/internal" +) + +func TestValidateDynClientRegistrationAuthorizationBadReq(t *testing.T) { + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + c := client.Client{OutfacingID: "someid"} + u := "https://www.something.com" + hr := &http.Request{Header: map[string][]string{}, URL: urlx.ParseOrPanic(u), RequestURI: u} + err := h.ValidateDynClientRegistrationAuthorization(hr, c) + require.EqualValues(t, "The request could not be authorized", err.Error()) +} + +func TestValidateDynClientRegistrationAuthorizationBadBasicAuthNoBase64(t *testing.T) { + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + c := client.Client{OutfacingID: "someid"} + u := "https://www.something.com" + hr := &http.Request{Header: map[string][]string{}, URL: urlx.ParseOrPanic(u), RequestURI: u} + hr.Header.Add("Authorization", "Basic something") + err := h.ValidateDynClientRegistrationAuthorization(hr, c) + require.EqualValues(t, "The request could not be authorized", err.Error()) +} + +func TestValidateDynClientRegistrationAuthorizationBadBasicAuthKo(t *testing.T) { + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + c := client.Client{OutfacingID: "client"} + u := "https://www.something.com" + hr := &http.Request{Header: map[string][]string{}, URL: urlx.ParseOrPanic(u), RequestURI: u} + hr.Header.Add("Authorization", "Basic Y2xpZW50OnNlY3JldA==") + err := h.ValidateDynClientRegistrationAuthorization(hr, c) + require.EqualValues(t, "The request could not be authorized", err.Error()) +} diff --git a/cypress/integration/openid/dynamic_client_registration.js b/cypress/integration/openid/dynamic_client_registration.js index 86bf1c49c10..8bc8eb83256 100644 --- a/cypress/integration/openid/dynamic_client_registration.js +++ b/cypress/integration/openid/dynamic_client_registration.js @@ -13,7 +13,6 @@ describe('The Clients Pubic Interface', function () { grant_types: ['client_credentials'] } }).then((response) => { - console.log(response.body) expect(response.body.client_secret).to.equal('secret') }) }) @@ -37,7 +36,7 @@ describe('The Clients Pubic Interface', function () { failOnStatusCode: false, url: Cypress.env('public_url') + '/connect/register?client_id=clientid' }).then((response) => { - expect(response.status).to.eq(401) + expect(response.status).to .eq(401) }) }) @@ -56,7 +55,6 @@ describe('The Clients Pubic Interface', function () { grant_types: ['client_credentials'] } }).then((response) => { - console.log(response.body) expect(response.body.client_name).to.equal('clientName2') }) }) diff --git a/quickstart-postgres.yml b/quickstart-postgres.yml index 40d42d2ab8d..0ea4dfd0f4b 100644 --- a/quickstart-postgres.yml +++ b/quickstart-postgres.yml @@ -13,6 +13,17 @@ version: '3.7' services: + + hydra-migrate: + image: oryd/hydra:v1.10.2 + environment: + - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 + + hydra: + image: oryd/hydra:v1.10.2 + environment: + - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 + postgresd: image: postgres:9.6 ports: @@ -21,13 +32,5 @@ services: - POSTGRES_USER=hydra - POSTGRES_PASSWORD=secret - POSTGRES_DB=hydra - hydra-migrate: - image: oryd/hydra:v1.9.2 - environment: - - DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4 - - SECRETS_SYSTEM=11112222333344445555666677778888 - command: - migrate sql -e --yes - restart: on-failure - depends_on: - - postgresd + networks: + - intranet From ad3af1aee9ef2f5c1ee4bf0b1629ccc8f23c4ef8 Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Tue, 13 Jul 2021 13:23:27 +0200 Subject: [PATCH 20/41] Fix prettier issue --- cypress/integration/openid/dynamic_client_registration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/openid/dynamic_client_registration.js b/cypress/integration/openid/dynamic_client_registration.js index 8bc8eb83256..ff601672948 100644 --- a/cypress/integration/openid/dynamic_client_registration.js +++ b/cypress/integration/openid/dynamic_client_registration.js @@ -36,7 +36,7 @@ describe('The Clients Pubic Interface', function () { failOnStatusCode: false, url: Cypress.env('public_url') + '/connect/register?client_id=clientid' }).then((response) => { - expect(response.status).to .eq(401) + expect(response.status).to.eq(401) }) }) From bfa82a14d96a0531e11783f721cdac7f79b6440f Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Mon, 19 Jul 2021 08:44:26 +0200 Subject: [PATCH 21/41] Fix merge confict --- internal/httpclient/models/volume.go | 3 ++- spec/api.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/httpclient/models/volume.go b/internal/httpclient/models/volume.go index a8a725e2cf8..a27d9734b32 100644 --- a/internal/httpclient/models/volume.go +++ b/internal/httpclient/models/volume.go @@ -42,7 +42,8 @@ type Volume struct { // Required: true Options map[string]string `json:"Options"` - // The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. + // The level at which the volume exists. Either `global` for cluster-wide, + // or `local` for machine level. // Required: true Scope *string `json:"Scope"` diff --git a/spec/api.json b/spec/api.json index 3c9b484f6df..19dcaaf3e30 100755 --- a/spec/api.json +++ b/spec/api.json @@ -2647,7 +2647,7 @@ } }, "Scope": { - "description": "The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level.", + "description": "The level at which the volume exists. Either `global` for cluster-wide,\nor `local` for machine level.", "type": "string" }, "Status": { From 054bbbcf7a8344ea1e1b2a3835b4fc0a26f3f6ca Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Mon, 19 Jul 2021 09:07:43 +0200 Subject: [PATCH 22/41] Merge remote/origin --- .../accept_consent_request_parameters.go | 49 +- .../admin/accept_consent_request_responses.go | 12 +- .../admin/accept_login_request_parameters.go | 49 +- .../admin/accept_login_request_responses.go | 18 +- .../admin/accept_logout_request_parameters.go | 45 +- .../admin/accept_logout_request_responses.go | 12 +- .../httpclient/client/admin/admin_client.go | 423 +++++++++++------- .../create_json_web_key_set_parameters.go | 50 ++- .../create_json_web_key_set_responses.go | 15 +- .../admin/create_o_auth2_client_parameters.go | 45 +- .../admin/create_o_auth2_client_responses.go | 15 +- .../admin/delete_json_web_key_parameters.go | 51 ++- .../admin/delete_json_web_key_responses.go | 16 +- .../delete_json_web_key_set_parameters.go | 46 +- .../delete_json_web_key_set_responses.go | 16 +- .../admin/delete_o_auth2_client_parameters.go | 46 +- .../admin/delete_o_auth2_client_responses.go | 13 +- .../admin/delete_o_auth2_token_parameters.go | 45 +- .../admin/delete_o_auth2_token_responses.go | 13 +- ...lush_inactive_o_auth2_tokens_parameters.go | 45 +- ...flush_inactive_o_auth2_tokens_responses.go | 13 +- .../admin/get_consent_request_parameters.go | 45 +- .../admin/get_consent_request_responses.go | 15 +- .../admin/get_json_web_key_parameters.go | 51 ++- .../admin/get_json_web_key_responses.go | 12 +- .../admin/get_json_web_key_set_parameters.go | 46 +- .../admin/get_json_web_key_set_responses.go | 15 +- .../admin/get_login_request_parameters.go | 45 +- .../admin/get_login_request_responses.go | 18 +- .../admin/get_logout_request_parameters.go | 45 +- .../admin/get_logout_request_responses.go | 15 +- .../admin/get_o_auth2_client_parameters.go | 46 +- .../admin/get_o_auth2_client_responses.go | 12 +- .../client/admin/get_version_parameters.go | 42 +- .../client/admin/get_version_responses.go | 6 +- .../introspect_o_auth2_token_parameters.go | 56 ++- .../introspect_o_auth2_token_responses.go | 12 +- .../admin/is_instance_alive_parameters.go | 42 +- .../admin/is_instance_alive_responses.go | 9 +- .../admin/list_o_auth2_clients_parameters.go | 61 ++- .../admin/list_o_auth2_clients_responses.go | 9 +- ...ist_subject_consent_sessions_parameters.go | 45 +- ...list_subject_consent_sessions_responses.go | 12 +- .../admin/patch_o_auth2_client_parameters.go | 48 +- .../admin/patch_o_auth2_client_responses.go | 9 +- .../reject_consent_request_parameters.go | 49 +- .../admin/reject_consent_request_responses.go | 12 +- .../admin/reject_login_request_parameters.go | 49 +- .../admin/reject_login_request_responses.go | 18 +- .../admin/reject_logout_request_parameters.go | 49 +- .../admin/reject_logout_request_responses.go | 13 +- ...evoke_authentication_session_parameters.go | 45 +- ...revoke_authentication_session_responses.go | 13 +- .../revoke_consent_sessions_parameters.go | 63 ++- .../revoke_consent_sessions_responses.go | 13 +- .../admin/update_json_web_key_parameters.go | 55 ++- .../admin/update_json_web_key_responses.go | 15 +- .../update_json_web_key_set_parameters.go | 50 ++- .../update_json_web_key_set_responses.go | 15 +- .../admin/update_o_auth2_client_parameters.go | 48 +- .../admin/update_o_auth2_client_responses.go | 9 +- .../client/metadata/metadata_client.go | 17 +- .../client/metadata/prometheus_parameters.go | 42 +- .../client/metadata/prometheus_responses.go | 7 +- .../public/disconnect_user_parameters.go | 42 +- .../public/disconnect_user_responses.go | 7 +- ...scover_open_id_configuration_parameters.go | 42 +- ...iscover_open_id_configuration_responses.go | 12 +- .../public/is_instance_ready_parameters.go | 42 +- .../public/is_instance_ready_responses.go | 9 +- .../client/public/oauth2_token_parameters.go | 60 ++- .../client/public/oauth2_token_responses.go | 15 +- .../client/public/oauth_auth_parameters.go | 42 +- .../client/public/oauth_auth_responses.go | 13 +- .../httpclient/client/public/public_client.go | 291 ++++++++++-- .../public/revoke_o_auth2_token_parameters.go | 44 +- .../public/revoke_o_auth2_token_responses.go | 13 +- .../client/public/userinfo_parameters.go | 42 +- .../client/public/userinfo_responses.go | 12 +- .../client/public/well_known_parameters.go | 42 +- .../client/public/well_known_responses.go | 9 +- .../models/accept_consent_request.go | 82 +++- .../httpclient/models/accept_login_request.go | 7 + .../httpclient/models/completed_request.go | 7 + internal/httpclient/models/consent_request.go | 84 +++- .../models/consent_request_session.go | 7 + .../models/container_wait_o_k_body_error.go | 7 + .../flush_inactive_o_auth2_tokens_request.go | 8 +- .../models/health_not_ready_status.go | 7 + internal/httpclient/models/health_status.go | 7 + internal/httpclient/models/json_error.go | 11 + internal/httpclient/models/json_web_key.go | 23 + .../httpclient/models/json_web_key_set.go | 34 +- .../json_web_key_set_generator_request.go | 7 + internal/httpclient/models/login_request.go | 81 +++- internal/httpclient/models/logout_request.go | 31 +- internal/httpclient/models/null_time.go | 7 + internal/httpclient/models/o_auth2_client.go | 153 ++++++- .../models/o_auth2_token_introspection.go | 7 + .../models/oauth2_token_response.go | 7 + .../models/open_id_connect_context.go | 7 + internal/httpclient/models/patch_document.go | 9 + internal/httpclient/models/patch_request.go | 24 + internal/httpclient/models/plugin_config.go | 165 ++++++- .../httpclient/models/plugin_config_args.go | 7 + .../models/plugin_config_interface.go | 36 ++ .../models/plugin_config_linux_swagger.go | 33 ++ .../models/plugin_config_network.go | 7 + .../httpclient/models/plugin_config_rootfs.go | 7 + .../httpclient/models/plugin_config_user.go | 7 + internal/httpclient/models/plugin_device.go | 7 + internal/httpclient/models/plugin_env.go | 7 + .../models/plugin_interface_type.go | 7 + internal/httpclient/models/plugin_mount.go | 7 + internal/httpclient/models/plugin_settings.go | 55 +++ .../models/previous_consent_session.go | 101 ++++- internal/httpclient/models/reject_request.go | 7 + .../models/request_was_handled_response.go | 7 + .../models/string_slice_pipe_delimiter.go | 7 + .../httpclient/models/userinfo_response.go | 7 + internal/httpclient/models/version.go | 7 + internal/httpclient/models/volume.go | 42 +- .../httpclient/models/volume_usage_data.go | 7 + internal/httpclient/models/well_known.go | 12 + spec/api.json | 6 +- 125 files changed, 3049 insertions(+), 1188 deletions(-) diff --git a/internal/httpclient/client/admin/accept_consent_request_parameters.go b/internal/httpclient/client/admin/accept_consent_request_parameters.go index df23ce33395..c573076321b 100644 --- a/internal/httpclient/client/admin/accept_consent_request_parameters.go +++ b/internal/httpclient/client/admin/accept_consent_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewAcceptConsentRequestParams creates a new AcceptConsentRequestParams object -// with the default values initialized. +// NewAcceptConsentRequestParams creates a new AcceptConsentRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewAcceptConsentRequestParams() *AcceptConsentRequestParams { - var () return &AcceptConsentRequestParams{ - timeout: cr.DefaultTimeout, } } // NewAcceptConsentRequestParamsWithTimeout creates a new AcceptConsentRequestParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAcceptConsentRequestParamsWithTimeout(timeout time.Duration) *AcceptConsentRequestParams { - var () return &AcceptConsentRequestParams{ - timeout: timeout, } } // NewAcceptConsentRequestParamsWithContext creates a new AcceptConsentRequestParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAcceptConsentRequestParamsWithContext(ctx context.Context) *AcceptConsentRequestParams { - var () return &AcceptConsentRequestParams{ - Context: ctx, } } // NewAcceptConsentRequestParamsWithHTTPClient creates a new AcceptConsentRequestParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAcceptConsentRequestParamsWithHTTPClient(client *http.Client) *AcceptConsentRequestParams { - var () return &AcceptConsentRequestParams{ HTTPClient: client, } } -/*AcceptConsentRequestParams contains all the parameters to send to the API endpoint -for the accept consent request operation typically these are written to a http.Request +/* AcceptConsentRequestParams contains all the parameters to send to the API endpoint + for the accept consent request operation. + + Typically these are written to a http.Request. */ type AcceptConsentRequestParams struct { - /*Body*/ + // Body. Body *models.AcceptConsentRequest - /*ConsentChallenge*/ + + // ConsentChallenge. ConsentChallenge string timeout time.Duration @@ -72,6 +72,21 @@ type AcceptConsentRequestParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the accept consent request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AcceptConsentRequestParams) WithDefaults() *AcceptConsentRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the accept consent request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AcceptConsentRequestParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the accept consent request params func (o *AcceptConsentRequestParams) WithTimeout(timeout time.Duration) *AcceptConsentRequestParams { o.SetTimeout(timeout) @@ -134,7 +149,6 @@ func (o *AcceptConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -145,6 +159,7 @@ func (o *AcceptConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrConsentChallenge := o.ConsentChallenge qConsentChallenge := qrConsentChallenge if qConsentChallenge != "" { + if err := r.SetQueryParam("consent_challenge", qConsentChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/accept_consent_request_responses.go b/internal/httpclient/client/admin/accept_consent_request_responses.go index d192d9dd13d..ca1d9bb992e 100644 --- a/internal/httpclient/client/admin/accept_consent_request_responses.go +++ b/internal/httpclient/client/admin/accept_consent_request_responses.go @@ -41,9 +41,8 @@ func (o *AcceptConsentRequestReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewAcceptConsentRequestOK() *AcceptConsentRequestOK { return &AcceptConsentRequestOK{} } -/*AcceptConsentRequestOK handles this case with default header values. +/* AcceptConsentRequestOK describes a response with status code 200, with default header values. completedRequest */ @@ -63,7 +62,6 @@ type AcceptConsentRequestOK struct { func (o *AcceptConsentRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/accept][%d] acceptConsentRequestOK %+v", 200, o.Payload) } - func (o *AcceptConsentRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -85,7 +83,7 @@ func NewAcceptConsentRequestNotFound() *AcceptConsentRequestNotFound { return &AcceptConsentRequestNotFound{} } -/*AcceptConsentRequestNotFound handles this case with default header values. +/* AcceptConsentRequestNotFound describes a response with status code 404, with default header values. jsonError */ @@ -96,7 +94,6 @@ type AcceptConsentRequestNotFound struct { func (o *AcceptConsentRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/accept][%d] acceptConsentRequestNotFound %+v", 404, o.Payload) } - func (o *AcceptConsentRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -118,7 +115,7 @@ func NewAcceptConsentRequestInternalServerError() *AcceptConsentRequestInternalS return &AcceptConsentRequestInternalServerError{} } -/*AcceptConsentRequestInternalServerError handles this case with default header values. +/* AcceptConsentRequestInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -129,7 +126,6 @@ type AcceptConsentRequestInternalServerError struct { func (o *AcceptConsentRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/accept][%d] acceptConsentRequestInternalServerError %+v", 500, o.Payload) } - func (o *AcceptConsentRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/accept_login_request_parameters.go b/internal/httpclient/client/admin/accept_login_request_parameters.go index 20d130fc490..ad0c47b0d30 100644 --- a/internal/httpclient/client/admin/accept_login_request_parameters.go +++ b/internal/httpclient/client/admin/accept_login_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewAcceptLoginRequestParams creates a new AcceptLoginRequestParams object -// with the default values initialized. +// NewAcceptLoginRequestParams creates a new AcceptLoginRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewAcceptLoginRequestParams() *AcceptLoginRequestParams { - var () return &AcceptLoginRequestParams{ - timeout: cr.DefaultTimeout, } } // NewAcceptLoginRequestParamsWithTimeout creates a new AcceptLoginRequestParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAcceptLoginRequestParamsWithTimeout(timeout time.Duration) *AcceptLoginRequestParams { - var () return &AcceptLoginRequestParams{ - timeout: timeout, } } // NewAcceptLoginRequestParamsWithContext creates a new AcceptLoginRequestParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAcceptLoginRequestParamsWithContext(ctx context.Context) *AcceptLoginRequestParams { - var () return &AcceptLoginRequestParams{ - Context: ctx, } } // NewAcceptLoginRequestParamsWithHTTPClient creates a new AcceptLoginRequestParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAcceptLoginRequestParamsWithHTTPClient(client *http.Client) *AcceptLoginRequestParams { - var () return &AcceptLoginRequestParams{ HTTPClient: client, } } -/*AcceptLoginRequestParams contains all the parameters to send to the API endpoint -for the accept login request operation typically these are written to a http.Request +/* AcceptLoginRequestParams contains all the parameters to send to the API endpoint + for the accept login request operation. + + Typically these are written to a http.Request. */ type AcceptLoginRequestParams struct { - /*Body*/ + // Body. Body *models.AcceptLoginRequest - /*LoginChallenge*/ + + // LoginChallenge. LoginChallenge string timeout time.Duration @@ -72,6 +72,21 @@ type AcceptLoginRequestParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the accept login request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AcceptLoginRequestParams) WithDefaults() *AcceptLoginRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the accept login request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AcceptLoginRequestParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the accept login request params func (o *AcceptLoginRequestParams) WithTimeout(timeout time.Duration) *AcceptLoginRequestParams { o.SetTimeout(timeout) @@ -134,7 +149,6 @@ func (o *AcceptLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -145,6 +159,7 @@ func (o *AcceptLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s qrLoginChallenge := o.LoginChallenge qLoginChallenge := qrLoginChallenge if qLoginChallenge != "" { + if err := r.SetQueryParam("login_challenge", qLoginChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/accept_login_request_responses.go b/internal/httpclient/client/admin/accept_login_request_responses.go index 7f4b5a71e50..a92b31dee21 100644 --- a/internal/httpclient/client/admin/accept_login_request_responses.go +++ b/internal/httpclient/client/admin/accept_login_request_responses.go @@ -53,9 +53,8 @@ func (o *AcceptLoginRequestReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -64,7 +63,7 @@ func NewAcceptLoginRequestOK() *AcceptLoginRequestOK { return &AcceptLoginRequestOK{} } -/*AcceptLoginRequestOK handles this case with default header values. +/* AcceptLoginRequestOK describes a response with status code 200, with default header values. completedRequest */ @@ -75,7 +74,6 @@ type AcceptLoginRequestOK struct { func (o *AcceptLoginRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestOK %+v", 200, o.Payload) } - func (o *AcceptLoginRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -97,7 +95,7 @@ func NewAcceptLoginRequestBadRequest() *AcceptLoginRequestBadRequest { return &AcceptLoginRequestBadRequest{} } -/*AcceptLoginRequestBadRequest handles this case with default header values. +/* AcceptLoginRequestBadRequest describes a response with status code 400, with default header values. jsonError */ @@ -108,7 +106,6 @@ type AcceptLoginRequestBadRequest struct { func (o *AcceptLoginRequestBadRequest) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestBadRequest %+v", 400, o.Payload) } - func (o *AcceptLoginRequestBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -130,7 +127,7 @@ func NewAcceptLoginRequestUnauthorized() *AcceptLoginRequestUnauthorized { return &AcceptLoginRequestUnauthorized{} } -/*AcceptLoginRequestUnauthorized handles this case with default header values. +/* AcceptLoginRequestUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -141,7 +138,6 @@ type AcceptLoginRequestUnauthorized struct { func (o *AcceptLoginRequestUnauthorized) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestUnauthorized %+v", 401, o.Payload) } - func (o *AcceptLoginRequestUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -163,7 +159,7 @@ func NewAcceptLoginRequestNotFound() *AcceptLoginRequestNotFound { return &AcceptLoginRequestNotFound{} } -/*AcceptLoginRequestNotFound handles this case with default header values. +/* AcceptLoginRequestNotFound describes a response with status code 404, with default header values. jsonError */ @@ -174,7 +170,6 @@ type AcceptLoginRequestNotFound struct { func (o *AcceptLoginRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestNotFound %+v", 404, o.Payload) } - func (o *AcceptLoginRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -196,7 +191,7 @@ func NewAcceptLoginRequestInternalServerError() *AcceptLoginRequestInternalServe return &AcceptLoginRequestInternalServerError{} } -/*AcceptLoginRequestInternalServerError handles this case with default header values. +/* AcceptLoginRequestInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -207,7 +202,6 @@ type AcceptLoginRequestInternalServerError struct { func (o *AcceptLoginRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestInternalServerError %+v", 500, o.Payload) } - func (o *AcceptLoginRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/accept_logout_request_parameters.go b/internal/httpclient/client/admin/accept_logout_request_parameters.go index f5f48782535..aa8727c2724 100644 --- a/internal/httpclient/client/admin/accept_logout_request_parameters.go +++ b/internal/httpclient/client/admin/accept_logout_request_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAcceptLogoutRequestParams creates a new AcceptLogoutRequestParams object -// with the default values initialized. +// NewAcceptLogoutRequestParams creates a new AcceptLogoutRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewAcceptLogoutRequestParams() *AcceptLogoutRequestParams { - var () return &AcceptLogoutRequestParams{ - timeout: cr.DefaultTimeout, } } // NewAcceptLogoutRequestParamsWithTimeout creates a new AcceptLogoutRequestParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewAcceptLogoutRequestParamsWithTimeout(timeout time.Duration) *AcceptLogoutRequestParams { - var () return &AcceptLogoutRequestParams{ - timeout: timeout, } } // NewAcceptLogoutRequestParamsWithContext creates a new AcceptLogoutRequestParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewAcceptLogoutRequestParamsWithContext(ctx context.Context) *AcceptLogoutRequestParams { - var () return &AcceptLogoutRequestParams{ - Context: ctx, } } // NewAcceptLogoutRequestParamsWithHTTPClient creates a new AcceptLogoutRequestParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewAcceptLogoutRequestParamsWithHTTPClient(client *http.Client) *AcceptLogoutRequestParams { - var () return &AcceptLogoutRequestParams{ HTTPClient: client, } } -/*AcceptLogoutRequestParams contains all the parameters to send to the API endpoint -for the accept logout request operation typically these are written to a http.Request +/* AcceptLogoutRequestParams contains all the parameters to send to the API endpoint + for the accept logout request operation. + + Typically these are written to a http.Request. */ type AcceptLogoutRequestParams struct { - /*LogoutChallenge*/ + // LogoutChallenge. LogoutChallenge string timeout time.Duration @@ -68,6 +67,21 @@ type AcceptLogoutRequestParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the accept logout request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AcceptLogoutRequestParams) WithDefaults() *AcceptLogoutRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the accept logout request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AcceptLogoutRequestParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the accept logout request params func (o *AcceptLogoutRequestParams) WithTimeout(timeout time.Duration) *AcceptLogoutRequestParams { o.SetTimeout(timeout) @@ -124,6 +138,7 @@ func (o *AcceptLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrLogoutChallenge := o.LogoutChallenge qLogoutChallenge := qrLogoutChallenge if qLogoutChallenge != "" { + if err := r.SetQueryParam("logout_challenge", qLogoutChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/accept_logout_request_responses.go b/internal/httpclient/client/admin/accept_logout_request_responses.go index 6cc29964d49..4ce46f91696 100644 --- a/internal/httpclient/client/admin/accept_logout_request_responses.go +++ b/internal/httpclient/client/admin/accept_logout_request_responses.go @@ -41,9 +41,8 @@ func (o *AcceptLogoutRequestReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewAcceptLogoutRequestOK() *AcceptLogoutRequestOK { return &AcceptLogoutRequestOK{} } -/*AcceptLogoutRequestOK handles this case with default header values. +/* AcceptLogoutRequestOK describes a response with status code 200, with default header values. completedRequest */ @@ -63,7 +62,6 @@ type AcceptLogoutRequestOK struct { func (o *AcceptLogoutRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/accept][%d] acceptLogoutRequestOK %+v", 200, o.Payload) } - func (o *AcceptLogoutRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -85,7 +83,7 @@ func NewAcceptLogoutRequestNotFound() *AcceptLogoutRequestNotFound { return &AcceptLogoutRequestNotFound{} } -/*AcceptLogoutRequestNotFound handles this case with default header values. +/* AcceptLogoutRequestNotFound describes a response with status code 404, with default header values. jsonError */ @@ -96,7 +94,6 @@ type AcceptLogoutRequestNotFound struct { func (o *AcceptLogoutRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/accept][%d] acceptLogoutRequestNotFound %+v", 404, o.Payload) } - func (o *AcceptLogoutRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -118,7 +115,7 @@ func NewAcceptLogoutRequestInternalServerError() *AcceptLogoutRequestInternalSer return &AcceptLogoutRequestInternalServerError{} } -/*AcceptLogoutRequestInternalServerError handles this case with default header values. +/* AcceptLogoutRequestInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -129,7 +126,6 @@ type AcceptLogoutRequestInternalServerError struct { func (o *AcceptLogoutRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/accept][%d] acceptLogoutRequestInternalServerError %+v", 500, o.Payload) } - func (o *AcceptLogoutRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/admin_client.go b/internal/httpclient/client/admin/admin_client.go index e626d4ccbdb..e5c1544c43e 100644 --- a/internal/httpclient/client/admin/admin_client.go +++ b/internal/httpclient/client/admin/admin_client.go @@ -25,67 +25,70 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - AcceptConsentRequest(params *AcceptConsentRequestParams) (*AcceptConsentRequestOK, error) + AcceptConsentRequest(params *AcceptConsentRequestParams, opts ...ClientOption) (*AcceptConsentRequestOK, error) - AcceptLoginRequest(params *AcceptLoginRequestParams) (*AcceptLoginRequestOK, error) + AcceptLoginRequest(params *AcceptLoginRequestParams, opts ...ClientOption) (*AcceptLoginRequestOK, error) - AcceptLogoutRequest(params *AcceptLogoutRequestParams) (*AcceptLogoutRequestOK, error) + AcceptLogoutRequest(params *AcceptLogoutRequestParams, opts ...ClientOption) (*AcceptLogoutRequestOK, error) - CreateJSONWebKeySet(params *CreateJSONWebKeySetParams) (*CreateJSONWebKeySetCreated, error) + CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ...ClientOption) (*CreateJSONWebKeySetCreated, error) - CreateOAuth2Client(params *CreateOAuth2ClientParams) (*CreateOAuth2ClientCreated, error) + CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) - DeleteJSONWebKey(params *DeleteJSONWebKeyParams) (*DeleteJSONWebKeyNoContent, error) + DeleteJSONWebKey(params *DeleteJSONWebKeyParams, opts ...ClientOption) (*DeleteJSONWebKeyNoContent, error) - DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams) (*DeleteJSONWebKeySetNoContent, error) + DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ...ClientOption) (*DeleteJSONWebKeySetNoContent, error) - DeleteOAuth2Client(params *DeleteOAuth2ClientParams) (*DeleteOAuth2ClientNoContent, error) + DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) - DeleteOAuth2Token(params *DeleteOAuth2TokenParams) (*DeleteOAuth2TokenNoContent, error) + DeleteOAuth2Token(params *DeleteOAuth2TokenParams, opts ...ClientOption) (*DeleteOAuth2TokenNoContent, error) - FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams) (*FlushInactiveOAuth2TokensNoContent, error) + FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams, opts ...ClientOption) (*FlushInactiveOAuth2TokensNoContent, error) - GetConsentRequest(params *GetConsentRequestParams) (*GetConsentRequestOK, error) + GetConsentRequest(params *GetConsentRequestParams, opts ...ClientOption) (*GetConsentRequestOK, error) - GetJSONWebKey(params *GetJSONWebKeyParams) (*GetJSONWebKeyOK, error) + GetJSONWebKey(params *GetJSONWebKeyParams, opts ...ClientOption) (*GetJSONWebKeyOK, error) - GetJSONWebKeySet(params *GetJSONWebKeySetParams) (*GetJSONWebKeySetOK, error) + GetJSONWebKeySet(params *GetJSONWebKeySetParams, opts ...ClientOption) (*GetJSONWebKeySetOK, error) - GetLoginRequest(params *GetLoginRequestParams) (*GetLoginRequestOK, error) + GetLoginRequest(params *GetLoginRequestParams, opts ...ClientOption) (*GetLoginRequestOK, error) - GetLogoutRequest(params *GetLogoutRequestParams) (*GetLogoutRequestOK, error) + GetLogoutRequest(params *GetLogoutRequestParams, opts ...ClientOption) (*GetLogoutRequestOK, error) - GetOAuth2Client(params *GetOAuth2ClientParams) (*GetOAuth2ClientOK, error) + GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) - GetVersion(params *GetVersionParams) (*GetVersionOK, error) + GetVersion(params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error) - IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams) (*IntrospectOAuth2TokenOK, error) + IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams, opts ...ClientOption) (*IntrospectOAuth2TokenOK, error) - IsInstanceAlive(params *IsInstanceAliveParams) (*IsInstanceAliveOK, error) + IsInstanceAlive(params *IsInstanceAliveParams, opts ...ClientOption) (*IsInstanceAliveOK, error) - ListOAuth2Clients(params *ListOAuth2ClientsParams) (*ListOAuth2ClientsOK, error) + ListOAuth2Clients(params *ListOAuth2ClientsParams, opts ...ClientOption) (*ListOAuth2ClientsOK, error) - ListSubjectConsentSessions(params *ListSubjectConsentSessionsParams) (*ListSubjectConsentSessionsOK, error) + ListSubjectConsentSessions(params *ListSubjectConsentSessionsParams, opts ...ClientOption) (*ListSubjectConsentSessionsOK, error) - PatchOAuth2Client(params *PatchOAuth2ClientParams) (*PatchOAuth2ClientOK, error) + PatchOAuth2Client(params *PatchOAuth2ClientParams, opts ...ClientOption) (*PatchOAuth2ClientOK, error) - RejectConsentRequest(params *RejectConsentRequestParams) (*RejectConsentRequestOK, error) + RejectConsentRequest(params *RejectConsentRequestParams, opts ...ClientOption) (*RejectConsentRequestOK, error) - RejectLoginRequest(params *RejectLoginRequestParams) (*RejectLoginRequestOK, error) + RejectLoginRequest(params *RejectLoginRequestParams, opts ...ClientOption) (*RejectLoginRequestOK, error) - RejectLogoutRequest(params *RejectLogoutRequestParams) (*RejectLogoutRequestNoContent, error) + RejectLogoutRequest(params *RejectLogoutRequestParams, opts ...ClientOption) (*RejectLogoutRequestNoContent, error) - RevokeAuthenticationSession(params *RevokeAuthenticationSessionParams) (*RevokeAuthenticationSessionNoContent, error) + RevokeAuthenticationSession(params *RevokeAuthenticationSessionParams, opts ...ClientOption) (*RevokeAuthenticationSessionNoContent, error) - RevokeConsentSessions(params *RevokeConsentSessionsParams) (*RevokeConsentSessionsNoContent, error) + RevokeConsentSessions(params *RevokeConsentSessionsParams, opts ...ClientOption) (*RevokeConsentSessionsNoContent, error) - UpdateJSONWebKey(params *UpdateJSONWebKeyParams) (*UpdateJSONWebKeyOK, error) + UpdateJSONWebKey(params *UpdateJSONWebKeyParams, opts ...ClientOption) (*UpdateJSONWebKeyOK, error) - UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams) (*UpdateJSONWebKeySetOK, error) + UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ...ClientOption) (*UpdateJSONWebKeySetOK, error) - UpdateOAuth2Client(params *UpdateOAuth2ClientParams) (*UpdateOAuth2ClientOK, error) + UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) SetTransport(transport runtime.ClientTransport) } @@ -110,13 +113,12 @@ consent request should be used as basis for future requests. The response contains a redirect URL which the consent provider should redirect the user-agent to. */ -func (a *Client) AcceptConsentRequest(params *AcceptConsentRequestParams) (*AcceptConsentRequestOK, error) { +func (a *Client) AcceptConsentRequest(params *AcceptConsentRequestParams, opts ...ClientOption) (*AcceptConsentRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAcceptConsentRequestParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "acceptConsentRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/consent/accept", @@ -127,7 +129,12 @@ func (a *Client) AcceptConsentRequest(params *AcceptConsentRequestParams) (*Acce Reader: &AcceptConsentRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -158,13 +165,12 @@ a cookie. The response contains a redirect URL which the login provider should redirect the user-agent to. */ -func (a *Client) AcceptLoginRequest(params *AcceptLoginRequestParams) (*AcceptLoginRequestOK, error) { +func (a *Client) AcceptLoginRequest(params *AcceptLoginRequestParams, opts ...ClientOption) (*AcceptLoginRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAcceptLoginRequestParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "acceptLoginRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/login/accept", @@ -175,7 +181,12 @@ func (a *Client) AcceptLoginRequest(params *AcceptLoginRequestParams) (*AcceptLo Reader: &AcceptLoginRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -197,13 +208,12 @@ No body is required. The response contains a redirect URL which the consent provider should redirect the user-agent to. */ -func (a *Client) AcceptLogoutRequest(params *AcceptLogoutRequestParams) (*AcceptLogoutRequestOK, error) { +func (a *Client) AcceptLogoutRequest(params *AcceptLogoutRequestParams, opts ...ClientOption) (*AcceptLogoutRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAcceptLogoutRequestParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "acceptLogoutRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/logout/accept", @@ -214,7 +224,12 @@ func (a *Client) AcceptLogoutRequest(params *AcceptLogoutRequestParams) (*Accept Reader: &AcceptLogoutRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -235,13 +250,12 @@ func (a *Client) AcceptLogoutRequest(params *AcceptLogoutRequestParams) (*Accept A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams) (*CreateJSONWebKeySetCreated, error) { +func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ...ClientOption) (*CreateJSONWebKeySetCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateJSONWebKeySetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createJsonWebKeySet", Method: "POST", PathPattern: "/keys/{set}", @@ -252,7 +266,12 @@ func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams) (*Create Reader: &CreateJSONWebKeySetReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -273,13 +292,12 @@ func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams) (*Create OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams) (*CreateOAuth2ClientCreated, error) { +func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateOAuth2ClientParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "createOAuth2Client", Method: "POST", PathPattern: "/clients", @@ -290,7 +308,12 @@ func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams) (*CreateOA Reader: &CreateOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -311,13 +334,12 @@ func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams) (*CreateOA A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) DeleteJSONWebKey(params *DeleteJSONWebKeyParams) (*DeleteJSONWebKeyNoContent, error) { +func (a *Client) DeleteJSONWebKey(params *DeleteJSONWebKeyParams, opts ...ClientOption) (*DeleteJSONWebKeyNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteJSONWebKeyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteJsonWebKey", Method: "DELETE", PathPattern: "/keys/{set}/{kid}", @@ -328,7 +350,12 @@ func (a *Client) DeleteJSONWebKey(params *DeleteJSONWebKeyParams) (*DeleteJSONWe Reader: &DeleteJSONWebKeyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -349,13 +376,12 @@ func (a *Client) DeleteJSONWebKey(params *DeleteJSONWebKeyParams) (*DeleteJSONWe A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams) (*DeleteJSONWebKeySetNoContent, error) { +func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ...ClientOption) (*DeleteJSONWebKeySetNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteJSONWebKeySetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteJsonWebKeySet", Method: "DELETE", PathPattern: "/keys/{set}", @@ -366,7 +392,12 @@ func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams) (*Delete Reader: &DeleteJSONWebKeySetReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -387,13 +418,12 @@ func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams) (*Delete OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams) (*DeleteOAuth2ClientNoContent, error) { +func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteOAuth2ClientParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteOAuth2Client", Method: "DELETE", PathPattern: "/clients/{id}", @@ -404,7 +434,12 @@ func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams) (*DeleteOA Reader: &DeleteOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -423,13 +458,12 @@ func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams) (*DeleteOA This endpoint deletes OAuth2 access tokens issued for a client from the database */ -func (a *Client) DeleteOAuth2Token(params *DeleteOAuth2TokenParams) (*DeleteOAuth2TokenNoContent, error) { +func (a *Client) DeleteOAuth2Token(params *DeleteOAuth2TokenParams, opts ...ClientOption) (*DeleteOAuth2TokenNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteOAuth2TokenParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "deleteOAuth2Token", Method: "DELETE", PathPattern: "/oauth2/tokens", @@ -440,7 +474,12 @@ func (a *Client) DeleteOAuth2Token(params *DeleteOAuth2TokenParams) (*DeleteOAut Reader: &DeleteOAuth2TokenReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -461,13 +500,12 @@ func (a *Client) DeleteOAuth2Token(params *DeleteOAuth2TokenParams) (*DeleteOAut not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be flushed as they are deleted automatically when performing the refresh flow. */ -func (a *Client) FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams) (*FlushInactiveOAuth2TokensNoContent, error) { +func (a *Client) FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams, opts ...ClientOption) (*FlushInactiveOAuth2TokensNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewFlushInactiveOAuth2TokensParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "flushInactiveOAuth2Tokens", Method: "POST", PathPattern: "/oauth2/flush", @@ -478,7 +516,12 @@ func (a *Client) FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensPara Reader: &FlushInactiveOAuth2TokensReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -506,13 +549,12 @@ The consent challenge is appended to the consent provider's URL to which the sub provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. */ -func (a *Client) GetConsentRequest(params *GetConsentRequestParams) (*GetConsentRequestOK, error) { +func (a *Client) GetConsentRequest(params *GetConsentRequestParams, opts ...ClientOption) (*GetConsentRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetConsentRequestParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getConsentRequest", Method: "GET", PathPattern: "/oauth2/auth/requests/consent", @@ -523,7 +565,12 @@ func (a *Client) GetConsentRequest(params *GetConsentRequestParams) (*GetConsent Reader: &GetConsentRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -542,13 +589,12 @@ func (a *Client) GetConsentRequest(params *GetConsentRequestParams) (*GetConsent This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid). */ -func (a *Client) GetJSONWebKey(params *GetJSONWebKeyParams) (*GetJSONWebKeyOK, error) { +func (a *Client) GetJSONWebKey(params *GetJSONWebKeyParams, opts ...ClientOption) (*GetJSONWebKeyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetJSONWebKeyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getJsonWebKey", Method: "GET", PathPattern: "/keys/{set}/{kid}", @@ -559,7 +605,12 @@ func (a *Client) GetJSONWebKey(params *GetJSONWebKeyParams) (*GetJSONWebKeyOK, e Reader: &GetJSONWebKeyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -580,13 +631,12 @@ func (a *Client) GetJSONWebKey(params *GetJSONWebKeyParams) (*GetJSONWebKeyOK, e A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) GetJSONWebKeySet(params *GetJSONWebKeySetParams) (*GetJSONWebKeySetOK, error) { +func (a *Client) GetJSONWebKeySet(params *GetJSONWebKeySetParams, opts ...ClientOption) (*GetJSONWebKeySetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetJSONWebKeySetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getJsonWebKeySet", Method: "GET", PathPattern: "/keys/{set}", @@ -597,7 +647,12 @@ func (a *Client) GetJSONWebKeySet(params *GetJSONWebKeySetParams) (*GetJSONWebKe Reader: &GetJSONWebKeySetReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -622,13 +677,12 @@ a subject (in OAuth2 the proper name for subject is "resource owner"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. */ -func (a *Client) GetLoginRequest(params *GetLoginRequestParams) (*GetLoginRequestOK, error) { +func (a *Client) GetLoginRequest(params *GetLoginRequestParams, opts ...ClientOption) (*GetLoginRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetLoginRequestParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getLoginRequest", Method: "GET", PathPattern: "/oauth2/auth/requests/login", @@ -639,7 +693,12 @@ func (a *Client) GetLoginRequest(params *GetLoginRequestParams) (*GetLoginReques Reader: &GetLoginRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -658,13 +717,12 @@ func (a *Client) GetLoginRequest(params *GetLoginRequestParams) (*GetLoginReques Use this endpoint to fetch a logout request. */ -func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams) (*GetLogoutRequestOK, error) { +func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams, opts ...ClientOption) (*GetLogoutRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetLogoutRequestParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getLogoutRequest", Method: "GET", PathPattern: "/oauth2/auth/requests/logout", @@ -675,7 +733,12 @@ func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams) (*GetLogoutReq Reader: &GetLogoutRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -696,13 +759,12 @@ func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams) (*GetLogoutReq OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams) (*GetOAuth2ClientOK, error) { +func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetOAuth2ClientParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getOAuth2Client", Method: "GET", PathPattern: "/clients/{id}", @@ -713,7 +775,12 @@ func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams) (*GetOAuth2Clien Reader: &GetOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -735,13 +802,12 @@ func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams) (*GetOAuth2Clien If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. */ -func (a *Client) GetVersion(params *GetVersionParams) (*GetVersionOK, error) { +func (a *Client) GetVersion(params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVersionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "getVersion", Method: "GET", PathPattern: "/version", @@ -752,7 +818,12 @@ func (a *Client) GetVersion(params *GetVersionParams) (*GetVersionOK, error) { Reader: &GetVersionReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -775,13 +846,12 @@ set additional data for a token by setting `accessTokenExtra` during the consent For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-endpoint/). */ -func (a *Client) IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams) (*IntrospectOAuth2TokenOK, error) { +func (a *Client) IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams, opts ...ClientOption) (*IntrospectOAuth2TokenOK, error) { // TODO: Validate the params before sending if params == nil { params = NewIntrospectOAuth2TokenParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "introspectOAuth2Token", Method: "POST", PathPattern: "/oauth2/introspect", @@ -792,7 +862,12 @@ func (a *Client) IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams) (*In Reader: &IntrospectOAuth2TokenReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -818,13 +893,12 @@ If the service supports TLS Edge Termination, this endpoint does not require the Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance. */ -func (a *Client) IsInstanceAlive(params *IsInstanceAliveParams) (*IsInstanceAliveOK, error) { +func (a *Client) IsInstanceAlive(params *IsInstanceAliveParams, opts ...ClientOption) (*IsInstanceAliveOK, error) { // TODO: Validate the params before sending if params == nil { params = NewIsInstanceAliveParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "isInstanceAlive", Method: "GET", PathPattern: "/health/alive", @@ -835,7 +909,12 @@ func (a *Client) IsInstanceAlive(params *IsInstanceAliveParams) (*IsInstanceAliv Reader: &IsInstanceAliveReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -858,13 +937,12 @@ OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usuall The "Link" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '; rel="{page}"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. */ -func (a *Client) ListOAuth2Clients(params *ListOAuth2ClientsParams) (*ListOAuth2ClientsOK, error) { +func (a *Client) ListOAuth2Clients(params *ListOAuth2ClientsParams, opts ...ClientOption) (*ListOAuth2ClientsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListOAuth2ClientsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listOAuth2Clients", Method: "GET", PathPattern: "/clients", @@ -875,7 +953,12 @@ func (a *Client) ListOAuth2Clients(params *ListOAuth2ClientsParams) (*ListOAuth2 Reader: &ListOAuth2ClientsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -900,13 +983,12 @@ empty JSON array with status code 200 OK. The "Link" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '; rel="{page}"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. */ -func (a *Client) ListSubjectConsentSessions(params *ListSubjectConsentSessionsParams) (*ListSubjectConsentSessionsOK, error) { +func (a *Client) ListSubjectConsentSessions(params *ListSubjectConsentSessionsParams, opts ...ClientOption) (*ListSubjectConsentSessionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListSubjectConsentSessionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "listSubjectConsentSessions", Method: "GET", PathPattern: "/oauth2/auth/sessions/consent", @@ -917,7 +999,12 @@ func (a *Client) ListSubjectConsentSessions(params *ListSubjectConsentSessionsPa Reader: &ListSubjectConsentSessionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -938,13 +1025,12 @@ func (a *Client) ListSubjectConsentSessions(params *ListSubjectConsentSessionsPa OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) PatchOAuth2Client(params *PatchOAuth2ClientParams) (*PatchOAuth2ClientOK, error) { +func (a *Client) PatchOAuth2Client(params *PatchOAuth2ClientParams, opts ...ClientOption) (*PatchOAuth2ClientOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchOAuth2ClientParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "patchOAuth2Client", Method: "PATCH", PathPattern: "/clients/{id}", @@ -955,7 +1041,12 @@ func (a *Client) PatchOAuth2Client(params *PatchOAuth2ClientParams) (*PatchOAuth Reader: &PatchOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -988,13 +1079,12 @@ The consent provider must include a reason why the consent was not granted. The response contains a redirect URL which the consent provider should redirect the user-agent to. */ -func (a *Client) RejectConsentRequest(params *RejectConsentRequestParams) (*RejectConsentRequestOK, error) { +func (a *Client) RejectConsentRequest(params *RejectConsentRequestParams, opts ...ClientOption) (*RejectConsentRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRejectConsentRequestParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "rejectConsentRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/consent/reject", @@ -1005,7 +1095,12 @@ func (a *Client) RejectConsentRequest(params *RejectConsentRequestParams) (*Reje Reader: &RejectConsentRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1035,13 +1130,12 @@ was be denied. The response contains a redirect URL which the login provider should redirect the user-agent to. */ -func (a *Client) RejectLoginRequest(params *RejectLoginRequestParams) (*RejectLoginRequestOK, error) { +func (a *Client) RejectLoginRequest(params *RejectLoginRequestParams, opts ...ClientOption) (*RejectLoginRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRejectLoginRequestParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "rejectLoginRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/login/reject", @@ -1052,7 +1146,12 @@ func (a *Client) RejectLoginRequest(params *RejectLoginRequestParams) (*RejectLo Reader: &RejectLoginRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1074,13 +1173,12 @@ No body is required. The response is empty as the logout provider has to chose what action to perform next. */ -func (a *Client) RejectLogoutRequest(params *RejectLogoutRequestParams) (*RejectLogoutRequestNoContent, error) { +func (a *Client) RejectLogoutRequest(params *RejectLogoutRequestParams, opts ...ClientOption) (*RejectLogoutRequestNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewRejectLogoutRequestParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "rejectLogoutRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/logout/reject", @@ -1091,7 +1189,12 @@ func (a *Client) RejectLogoutRequest(params *RejectLogoutRequestParams) (*Reject Reader: &RejectLogoutRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1112,13 +1215,12 @@ func (a *Client) RejectLogoutRequest(params *RejectLogoutRequestParams) (*Reject has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work with OpenID Connect Front- or Back-channel logout. */ -func (a *Client) RevokeAuthenticationSession(params *RevokeAuthenticationSessionParams) (*RevokeAuthenticationSessionNoContent, error) { +func (a *Client) RevokeAuthenticationSession(params *RevokeAuthenticationSessionParams, opts ...ClientOption) (*RevokeAuthenticationSessionNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewRevokeAuthenticationSessionParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "revokeAuthenticationSession", Method: "DELETE", PathPattern: "/oauth2/auth/sessions/login", @@ -1129,7 +1231,12 @@ func (a *Client) RevokeAuthenticationSession(params *RevokeAuthenticationSession Reader: &RevokeAuthenticationSessionReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1149,13 +1256,12 @@ func (a *Client) RevokeAuthenticationSession(params *RevokeAuthenticationSession This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and invalidates all associated OAuth 2.0 Access Tokens. */ -func (a *Client) RevokeConsentSessions(params *RevokeConsentSessionsParams) (*RevokeConsentSessionsNoContent, error) { +func (a *Client) RevokeConsentSessions(params *RevokeConsentSessionsParams, opts ...ClientOption) (*RevokeConsentSessionsNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewRevokeConsentSessionsParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "revokeConsentSessions", Method: "DELETE", PathPattern: "/oauth2/auth/sessions/consent", @@ -1166,7 +1272,12 @@ func (a *Client) RevokeConsentSessions(params *RevokeConsentSessionsParams) (*Re Reader: &RevokeConsentSessionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1187,13 +1298,12 @@ func (a *Client) RevokeConsentSessions(params *RevokeConsentSessionsParams) (*Re A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) UpdateJSONWebKey(params *UpdateJSONWebKeyParams) (*UpdateJSONWebKeyOK, error) { +func (a *Client) UpdateJSONWebKey(params *UpdateJSONWebKeyParams, opts ...ClientOption) (*UpdateJSONWebKeyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateJSONWebKeyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateJsonWebKey", Method: "PUT", PathPattern: "/keys/{set}/{kid}", @@ -1204,7 +1314,12 @@ func (a *Client) UpdateJSONWebKey(params *UpdateJSONWebKeyParams) (*UpdateJSONWe Reader: &UpdateJSONWebKeyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1225,13 +1340,12 @@ func (a *Client) UpdateJSONWebKey(params *UpdateJSONWebKeyParams) (*UpdateJSONWe A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams) (*UpdateJSONWebKeySetOK, error) { +func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ...ClientOption) (*UpdateJSONWebKeySetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateJSONWebKeySetParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateJsonWebKeySet", Method: "PUT", PathPattern: "/keys/{set}", @@ -1242,7 +1356,12 @@ func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams) (*Update Reader: &UpdateJSONWebKeySetReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -1263,13 +1382,12 @@ func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams) (*Update OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams) (*UpdateOAuth2ClientOK, error) { +func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateOAuth2ClientParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "updateOAuth2Client", Method: "PUT", PathPattern: "/clients/{id}", @@ -1280,7 +1398,12 @@ func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams) (*UpdateOA Reader: &UpdateOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/internal/httpclient/client/admin/create_json_web_key_set_parameters.go b/internal/httpclient/client/admin/create_json_web_key_set_parameters.go index e4c1c054393..43acf4eba80 100644 --- a/internal/httpclient/client/admin/create_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/create_json_web_key_set_parameters.go @@ -18,55 +18,55 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewCreateJSONWebKeySetParams creates a new CreateJSONWebKeySetParams object -// with the default values initialized. +// NewCreateJSONWebKeySetParams creates a new CreateJSONWebKeySetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateJSONWebKeySetParams() *CreateJSONWebKeySetParams { - var () return &CreateJSONWebKeySetParams{ - timeout: cr.DefaultTimeout, } } // NewCreateJSONWebKeySetParamsWithTimeout creates a new CreateJSONWebKeySetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateJSONWebKeySetParamsWithTimeout(timeout time.Duration) *CreateJSONWebKeySetParams { - var () return &CreateJSONWebKeySetParams{ - timeout: timeout, } } // NewCreateJSONWebKeySetParamsWithContext creates a new CreateJSONWebKeySetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateJSONWebKeySetParamsWithContext(ctx context.Context) *CreateJSONWebKeySetParams { - var () return &CreateJSONWebKeySetParams{ - Context: ctx, } } // NewCreateJSONWebKeySetParamsWithHTTPClient creates a new CreateJSONWebKeySetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateJSONWebKeySetParamsWithHTTPClient(client *http.Client) *CreateJSONWebKeySetParams { - var () return &CreateJSONWebKeySetParams{ HTTPClient: client, } } -/*CreateJSONWebKeySetParams contains all the parameters to send to the API endpoint -for the create Json web key set operation typically these are written to a http.Request +/* CreateJSONWebKeySetParams contains all the parameters to send to the API endpoint + for the create Json web key set operation. + + Typically these are written to a http.Request. */ type CreateJSONWebKeySetParams struct { - /*Body*/ + // Body. Body *models.JSONWebKeySetGeneratorRequest - /*Set - The set + /* Set. + + The set */ Set string @@ -75,6 +75,21 @@ type CreateJSONWebKeySetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create Json web key set params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateJSONWebKeySetParams) WithDefaults() *CreateJSONWebKeySetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create Json web key set params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateJSONWebKeySetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create Json web key set params func (o *CreateJSONWebKeySetParams) WithTimeout(timeout time.Duration) *CreateJSONWebKeySetParams { o.SetTimeout(timeout) @@ -137,7 +152,6 @@ func (o *CreateJSONWebKeySetParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/create_json_web_key_set_responses.go b/internal/httpclient/client/admin/create_json_web_key_set_responses.go index 9e2515c969b..564e5d51f39 100644 --- a/internal/httpclient/client/admin/create_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/create_json_web_key_set_responses.go @@ -47,9 +47,8 @@ func (o *CreateJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -58,7 +57,7 @@ func NewCreateJSONWebKeySetCreated() *CreateJSONWebKeySetCreated { return &CreateJSONWebKeySetCreated{} } -/*CreateJSONWebKeySetCreated handles this case with default header values. +/* CreateJSONWebKeySetCreated describes a response with status code 201, with default header values. JSONWebKeySet */ @@ -69,7 +68,6 @@ type CreateJSONWebKeySetCreated struct { func (o *CreateJSONWebKeySetCreated) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetCreated %+v", 201, o.Payload) } - func (o *CreateJSONWebKeySetCreated) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -91,7 +89,7 @@ func NewCreateJSONWebKeySetUnauthorized() *CreateJSONWebKeySetUnauthorized { return &CreateJSONWebKeySetUnauthorized{} } -/*CreateJSONWebKeySetUnauthorized handles this case with default header values. +/* CreateJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -102,7 +100,6 @@ type CreateJSONWebKeySetUnauthorized struct { func (o *CreateJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetUnauthorized %+v", 401, o.Payload) } - func (o *CreateJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -124,7 +121,7 @@ func NewCreateJSONWebKeySetForbidden() *CreateJSONWebKeySetForbidden { return &CreateJSONWebKeySetForbidden{} } -/*CreateJSONWebKeySetForbidden handles this case with default header values. +/* CreateJSONWebKeySetForbidden describes a response with status code 403, with default header values. jsonError */ @@ -135,7 +132,6 @@ type CreateJSONWebKeySetForbidden struct { func (o *CreateJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetForbidden %+v", 403, o.Payload) } - func (o *CreateJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -157,7 +153,7 @@ func NewCreateJSONWebKeySetInternalServerError() *CreateJSONWebKeySetInternalSer return &CreateJSONWebKeySetInternalServerError{} } -/*CreateJSONWebKeySetInternalServerError handles this case with default header values. +/* CreateJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -168,7 +164,6 @@ type CreateJSONWebKeySetInternalServerError struct { func (o *CreateJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetInternalServerError %+v", 500, o.Payload) } - func (o *CreateJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/create_o_auth2_client_parameters.go b/internal/httpclient/client/admin/create_o_auth2_client_parameters.go index c3ce0633992..f719021b83a 100644 --- a/internal/httpclient/client/admin/create_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/create_o_auth2_client_parameters.go @@ -18,51 +18,50 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewCreateOAuth2ClientParams creates a new CreateOAuth2ClientParams object -// with the default values initialized. +// NewCreateOAuth2ClientParams creates a new CreateOAuth2ClientParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewCreateOAuth2ClientParams() *CreateOAuth2ClientParams { - var () return &CreateOAuth2ClientParams{ - timeout: cr.DefaultTimeout, } } // NewCreateOAuth2ClientParamsWithTimeout creates a new CreateOAuth2ClientParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewCreateOAuth2ClientParamsWithTimeout(timeout time.Duration) *CreateOAuth2ClientParams { - var () return &CreateOAuth2ClientParams{ - timeout: timeout, } } // NewCreateOAuth2ClientParamsWithContext creates a new CreateOAuth2ClientParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewCreateOAuth2ClientParamsWithContext(ctx context.Context) *CreateOAuth2ClientParams { - var () return &CreateOAuth2ClientParams{ - Context: ctx, } } // NewCreateOAuth2ClientParamsWithHTTPClient creates a new CreateOAuth2ClientParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewCreateOAuth2ClientParamsWithHTTPClient(client *http.Client) *CreateOAuth2ClientParams { - var () return &CreateOAuth2ClientParams{ HTTPClient: client, } } -/*CreateOAuth2ClientParams contains all the parameters to send to the API endpoint -for the create o auth2 client operation typically these are written to a http.Request +/* CreateOAuth2ClientParams contains all the parameters to send to the API endpoint + for the create o auth2 client operation. + + Typically these are written to a http.Request. */ type CreateOAuth2ClientParams struct { - /*Body*/ + // Body. Body *models.OAuth2Client timeout time.Duration @@ -70,6 +69,21 @@ type CreateOAuth2ClientParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the create o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateOAuth2ClientParams) WithDefaults() *CreateOAuth2ClientParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateOAuth2ClientParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the create o auth2 client params func (o *CreateOAuth2ClientParams) WithTimeout(timeout time.Duration) *CreateOAuth2ClientParams { o.SetTimeout(timeout) @@ -121,7 +135,6 @@ func (o *CreateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/create_o_auth2_client_responses.go b/internal/httpclient/client/admin/create_o_auth2_client_responses.go index 52af9e0716b..f4b2e9685bb 100644 --- a/internal/httpclient/client/admin/create_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/create_o_auth2_client_responses.go @@ -47,9 +47,8 @@ func (o *CreateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -58,7 +57,7 @@ func NewCreateOAuth2ClientCreated() *CreateOAuth2ClientCreated { return &CreateOAuth2ClientCreated{} } -/*CreateOAuth2ClientCreated handles this case with default header values. +/* CreateOAuth2ClientCreated describes a response with status code 201, with default header values. oAuth2Client */ @@ -69,7 +68,6 @@ type CreateOAuth2ClientCreated struct { func (o *CreateOAuth2ClientCreated) Error() string { return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientCreated %+v", 201, o.Payload) } - func (o *CreateOAuth2ClientCreated) GetPayload() *models.OAuth2Client { return o.Payload } @@ -91,7 +89,7 @@ func NewCreateOAuth2ClientBadRequest() *CreateOAuth2ClientBadRequest { return &CreateOAuth2ClientBadRequest{} } -/*CreateOAuth2ClientBadRequest handles this case with default header values. +/* CreateOAuth2ClientBadRequest describes a response with status code 400, with default header values. jsonError */ @@ -102,7 +100,6 @@ type CreateOAuth2ClientBadRequest struct { func (o *CreateOAuth2ClientBadRequest) Error() string { return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientBadRequest %+v", 400, o.Payload) } - func (o *CreateOAuth2ClientBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -124,7 +121,7 @@ func NewCreateOAuth2ClientConflict() *CreateOAuth2ClientConflict { return &CreateOAuth2ClientConflict{} } -/*CreateOAuth2ClientConflict handles this case with default header values. +/* CreateOAuth2ClientConflict describes a response with status code 409, with default header values. jsonError */ @@ -135,7 +132,6 @@ type CreateOAuth2ClientConflict struct { func (o *CreateOAuth2ClientConflict) Error() string { return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientConflict %+v", 409, o.Payload) } - func (o *CreateOAuth2ClientConflict) GetPayload() *models.JSONError { return o.Payload } @@ -157,7 +153,7 @@ func NewCreateOAuth2ClientInternalServerError() *CreateOAuth2ClientInternalServe return &CreateOAuth2ClientInternalServerError{} } -/*CreateOAuth2ClientInternalServerError handles this case with default header values. +/* CreateOAuth2ClientInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -168,7 +164,6 @@ type CreateOAuth2ClientInternalServerError struct { func (o *CreateOAuth2ClientInternalServerError) Error() string { return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientInternalServerError %+v", 500, o.Payload) } - func (o *CreateOAuth2ClientInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_json_web_key_parameters.go b/internal/httpclient/client/admin/delete_json_web_key_parameters.go index 4f4f4fa4401..c1e71f1d5d8 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_parameters.go +++ b/internal/httpclient/client/admin/delete_json_web_key_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteJSONWebKeyParams creates a new DeleteJSONWebKeyParams object -// with the default values initialized. +// NewDeleteJSONWebKeyParams creates a new DeleteJSONWebKeyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteJSONWebKeyParams() *DeleteJSONWebKeyParams { - var () return &DeleteJSONWebKeyParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteJSONWebKeyParamsWithTimeout creates a new DeleteJSONWebKeyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteJSONWebKeyParamsWithTimeout(timeout time.Duration) *DeleteJSONWebKeyParams { - var () return &DeleteJSONWebKeyParams{ - timeout: timeout, } } // NewDeleteJSONWebKeyParamsWithContext creates a new DeleteJSONWebKeyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteJSONWebKeyParamsWithContext(ctx context.Context) *DeleteJSONWebKeyParams { - var () return &DeleteJSONWebKeyParams{ - Context: ctx, } } // NewDeleteJSONWebKeyParamsWithHTTPClient creates a new DeleteJSONWebKeyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteJSONWebKeyParamsWithHTTPClient(client *http.Client) *DeleteJSONWebKeyParams { - var () return &DeleteJSONWebKeyParams{ HTTPClient: client, } } -/*DeleteJSONWebKeyParams contains all the parameters to send to the API endpoint -for the delete Json web key operation typically these are written to a http.Request +/* DeleteJSONWebKeyParams contains all the parameters to send to the API endpoint + for the delete Json web key operation. + + Typically these are written to a http.Request. */ type DeleteJSONWebKeyParams struct { - /*Kid - The kid of the desired key + /* Kid. + The kid of the desired key */ Kid string - /*Set - The set + /* Set. + + The set */ Set string @@ -76,6 +76,21 @@ type DeleteJSONWebKeyParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete Json web key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteJSONWebKeyParams) WithDefaults() *DeleteJSONWebKeyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete Json web key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteJSONWebKeyParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete Json web key params func (o *DeleteJSONWebKeyParams) WithTimeout(timeout time.Duration) *DeleteJSONWebKeyParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/delete_json_web_key_responses.go b/internal/httpclient/client/admin/delete_json_web_key_responses.go index 6caea37bb35..d5331905a2c 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_responses.go +++ b/internal/httpclient/client/admin/delete_json_web_key_responses.go @@ -47,9 +47,8 @@ func (o *DeleteJSONWebKeyReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -58,9 +57,9 @@ func NewDeleteJSONWebKeyNoContent() *DeleteJSONWebKeyNoContent { return &DeleteJSONWebKeyNoContent{} } -/*DeleteJSONWebKeyNoContent handles this case with default header values. +/* DeleteJSONWebKeyNoContent describes a response with status code 204, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteJSONWebKeyNoContent struct { @@ -80,7 +79,7 @@ func NewDeleteJSONWebKeyUnauthorized() *DeleteJSONWebKeyUnauthorized { return &DeleteJSONWebKeyUnauthorized{} } -/*DeleteJSONWebKeyUnauthorized handles this case with default header values. +/* DeleteJSONWebKeyUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -91,7 +90,6 @@ type DeleteJSONWebKeyUnauthorized struct { func (o *DeleteJSONWebKeyUnauthorized) Error() string { return fmt.Sprintf("[DELETE /keys/{set}/{kid}][%d] deleteJsonWebKeyUnauthorized %+v", 401, o.Payload) } - func (o *DeleteJSONWebKeyUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -113,7 +111,7 @@ func NewDeleteJSONWebKeyForbidden() *DeleteJSONWebKeyForbidden { return &DeleteJSONWebKeyForbidden{} } -/*DeleteJSONWebKeyForbidden handles this case with default header values. +/* DeleteJSONWebKeyForbidden describes a response with status code 403, with default header values. jsonError */ @@ -124,7 +122,6 @@ type DeleteJSONWebKeyForbidden struct { func (o *DeleteJSONWebKeyForbidden) Error() string { return fmt.Sprintf("[DELETE /keys/{set}/{kid}][%d] deleteJsonWebKeyForbidden %+v", 403, o.Payload) } - func (o *DeleteJSONWebKeyForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -146,7 +143,7 @@ func NewDeleteJSONWebKeyInternalServerError() *DeleteJSONWebKeyInternalServerErr return &DeleteJSONWebKeyInternalServerError{} } -/*DeleteJSONWebKeyInternalServerError handles this case with default header values. +/* DeleteJSONWebKeyInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -157,7 +154,6 @@ type DeleteJSONWebKeyInternalServerError struct { func (o *DeleteJSONWebKeyInternalServerError) Error() string { return fmt.Sprintf("[DELETE /keys/{set}/{kid}][%d] deleteJsonWebKeyInternalServerError %+v", 500, o.Payload) } - func (o *DeleteJSONWebKeyInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go b/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go index a6e06c48d86..5bb84e5a07a 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteJSONWebKeySetParams creates a new DeleteJSONWebKeySetParams object -// with the default values initialized. +// NewDeleteJSONWebKeySetParams creates a new DeleteJSONWebKeySetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteJSONWebKeySetParams() *DeleteJSONWebKeySetParams { - var () return &DeleteJSONWebKeySetParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteJSONWebKeySetParamsWithTimeout creates a new DeleteJSONWebKeySetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteJSONWebKeySetParamsWithTimeout(timeout time.Duration) *DeleteJSONWebKeySetParams { - var () return &DeleteJSONWebKeySetParams{ - timeout: timeout, } } // NewDeleteJSONWebKeySetParamsWithContext creates a new DeleteJSONWebKeySetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteJSONWebKeySetParamsWithContext(ctx context.Context) *DeleteJSONWebKeySetParams { - var () return &DeleteJSONWebKeySetParams{ - Context: ctx, } } // NewDeleteJSONWebKeySetParamsWithHTTPClient creates a new DeleteJSONWebKeySetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteJSONWebKeySetParamsWithHTTPClient(client *http.Client) *DeleteJSONWebKeySetParams { - var () return &DeleteJSONWebKeySetParams{ HTTPClient: client, } } -/*DeleteJSONWebKeySetParams contains all the parameters to send to the API endpoint -for the delete Json web key set operation typically these are written to a http.Request +/* DeleteJSONWebKeySetParams contains all the parameters to send to the API endpoint + for the delete Json web key set operation. + + Typically these are written to a http.Request. */ type DeleteJSONWebKeySetParams struct { - /*Set - The set + /* Set. + The set */ Set string @@ -71,6 +70,21 @@ type DeleteJSONWebKeySetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete Json web key set params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteJSONWebKeySetParams) WithDefaults() *DeleteJSONWebKeySetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete Json web key set params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteJSONWebKeySetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete Json web key set params func (o *DeleteJSONWebKeySetParams) WithTimeout(timeout time.Duration) *DeleteJSONWebKeySetParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/delete_json_web_key_set_responses.go b/internal/httpclient/client/admin/delete_json_web_key_set_responses.go index 7e769a6c132..26ff80c09f9 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/delete_json_web_key_set_responses.go @@ -47,9 +47,8 @@ func (o *DeleteJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -58,9 +57,9 @@ func NewDeleteJSONWebKeySetNoContent() *DeleteJSONWebKeySetNoContent { return &DeleteJSONWebKeySetNoContent{} } -/*DeleteJSONWebKeySetNoContent handles this case with default header values. +/* DeleteJSONWebKeySetNoContent describes a response with status code 204, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteJSONWebKeySetNoContent struct { @@ -80,7 +79,7 @@ func NewDeleteJSONWebKeySetUnauthorized() *DeleteJSONWebKeySetUnauthorized { return &DeleteJSONWebKeySetUnauthorized{} } -/*DeleteJSONWebKeySetUnauthorized handles this case with default header values. +/* DeleteJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -91,7 +90,6 @@ type DeleteJSONWebKeySetUnauthorized struct { func (o *DeleteJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[DELETE /keys/{set}][%d] deleteJsonWebKeySetUnauthorized %+v", 401, o.Payload) } - func (o *DeleteJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -113,7 +111,7 @@ func NewDeleteJSONWebKeySetForbidden() *DeleteJSONWebKeySetForbidden { return &DeleteJSONWebKeySetForbidden{} } -/*DeleteJSONWebKeySetForbidden handles this case with default header values. +/* DeleteJSONWebKeySetForbidden describes a response with status code 403, with default header values. jsonError */ @@ -124,7 +122,6 @@ type DeleteJSONWebKeySetForbidden struct { func (o *DeleteJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[DELETE /keys/{set}][%d] deleteJsonWebKeySetForbidden %+v", 403, o.Payload) } - func (o *DeleteJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -146,7 +143,7 @@ func NewDeleteJSONWebKeySetInternalServerError() *DeleteJSONWebKeySetInternalSer return &DeleteJSONWebKeySetInternalServerError{} } -/*DeleteJSONWebKeySetInternalServerError handles this case with default header values. +/* DeleteJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -157,7 +154,6 @@ type DeleteJSONWebKeySetInternalServerError struct { func (o *DeleteJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[DELETE /keys/{set}][%d] deleteJsonWebKeySetInternalServerError %+v", 500, o.Payload) } - func (o *DeleteJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go b/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go index 6eb2b90b311..313a6b76fdf 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteOAuth2ClientParams creates a new DeleteOAuth2ClientParams object -// with the default values initialized. +// NewDeleteOAuth2ClientParams creates a new DeleteOAuth2ClientParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteOAuth2ClientParams() *DeleteOAuth2ClientParams { - var () return &DeleteOAuth2ClientParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteOAuth2ClientParamsWithTimeout creates a new DeleteOAuth2ClientParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteOAuth2ClientParamsWithTimeout(timeout time.Duration) *DeleteOAuth2ClientParams { - var () return &DeleteOAuth2ClientParams{ - timeout: timeout, } } // NewDeleteOAuth2ClientParamsWithContext creates a new DeleteOAuth2ClientParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteOAuth2ClientParamsWithContext(ctx context.Context) *DeleteOAuth2ClientParams { - var () return &DeleteOAuth2ClientParams{ - Context: ctx, } } // NewDeleteOAuth2ClientParamsWithHTTPClient creates a new DeleteOAuth2ClientParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteOAuth2ClientParamsWithHTTPClient(client *http.Client) *DeleteOAuth2ClientParams { - var () return &DeleteOAuth2ClientParams{ HTTPClient: client, } } -/*DeleteOAuth2ClientParams contains all the parameters to send to the API endpoint -for the delete o auth2 client operation typically these are written to a http.Request +/* DeleteOAuth2ClientParams contains all the parameters to send to the API endpoint + for the delete o auth2 client operation. + + Typically these are written to a http.Request. */ type DeleteOAuth2ClientParams struct { - /*ID - The id of the OAuth 2.0 Client. + /* ID. + The id of the OAuth 2.0 Client. */ ID string @@ -71,6 +70,21 @@ type DeleteOAuth2ClientParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteOAuth2ClientParams) WithDefaults() *DeleteOAuth2ClientParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteOAuth2ClientParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete o auth2 client params func (o *DeleteOAuth2ClientParams) WithTimeout(timeout time.Duration) *DeleteOAuth2ClientParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/delete_o_auth2_client_responses.go b/internal/httpclient/client/admin/delete_o_auth2_client_responses.go index db47f97db15..fb2869ba2d5 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/delete_o_auth2_client_responses.go @@ -41,9 +41,8 @@ func (o *DeleteOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,9 +51,9 @@ func NewDeleteOAuth2ClientNoContent() *DeleteOAuth2ClientNoContent { return &DeleteOAuth2ClientNoContent{} } -/*DeleteOAuth2ClientNoContent handles this case with default header values. +/* DeleteOAuth2ClientNoContent describes a response with status code 204, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteOAuth2ClientNoContent struct { @@ -74,7 +73,7 @@ func NewDeleteOAuth2ClientNotFound() *DeleteOAuth2ClientNotFound { return &DeleteOAuth2ClientNotFound{} } -/*DeleteOAuth2ClientNotFound handles this case with default header values. +/* DeleteOAuth2ClientNotFound describes a response with status code 404, with default header values. jsonError */ @@ -85,7 +84,6 @@ type DeleteOAuth2ClientNotFound struct { func (o *DeleteOAuth2ClientNotFound) Error() string { return fmt.Sprintf("[DELETE /clients/{id}][%d] deleteOAuth2ClientNotFound %+v", 404, o.Payload) } - func (o *DeleteOAuth2ClientNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -107,7 +105,7 @@ func NewDeleteOAuth2ClientInternalServerError() *DeleteOAuth2ClientInternalServe return &DeleteOAuth2ClientInternalServerError{} } -/*DeleteOAuth2ClientInternalServerError handles this case with default header values. +/* DeleteOAuth2ClientInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -118,7 +116,6 @@ type DeleteOAuth2ClientInternalServerError struct { func (o *DeleteOAuth2ClientInternalServerError) Error() string { return fmt.Sprintf("[DELETE /clients/{id}][%d] deleteOAuth2ClientInternalServerError %+v", 500, o.Payload) } - func (o *DeleteOAuth2ClientInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go b/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go index ae926e1d885..683579f246a 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go +++ b/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteOAuth2TokenParams creates a new DeleteOAuth2TokenParams object -// with the default values initialized. +// NewDeleteOAuth2TokenParams creates a new DeleteOAuth2TokenParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDeleteOAuth2TokenParams() *DeleteOAuth2TokenParams { - var () return &DeleteOAuth2TokenParams{ - timeout: cr.DefaultTimeout, } } // NewDeleteOAuth2TokenParamsWithTimeout creates a new DeleteOAuth2TokenParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDeleteOAuth2TokenParamsWithTimeout(timeout time.Duration) *DeleteOAuth2TokenParams { - var () return &DeleteOAuth2TokenParams{ - timeout: timeout, } } // NewDeleteOAuth2TokenParamsWithContext creates a new DeleteOAuth2TokenParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDeleteOAuth2TokenParamsWithContext(ctx context.Context) *DeleteOAuth2TokenParams { - var () return &DeleteOAuth2TokenParams{ - Context: ctx, } } // NewDeleteOAuth2TokenParamsWithHTTPClient creates a new DeleteOAuth2TokenParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDeleteOAuth2TokenParamsWithHTTPClient(client *http.Client) *DeleteOAuth2TokenParams { - var () return &DeleteOAuth2TokenParams{ HTTPClient: client, } } -/*DeleteOAuth2TokenParams contains all the parameters to send to the API endpoint -for the delete o auth2 token operation typically these are written to a http.Request +/* DeleteOAuth2TokenParams contains all the parameters to send to the API endpoint + for the delete o auth2 token operation. + + Typically these are written to a http.Request. */ type DeleteOAuth2TokenParams struct { - /*ClientID*/ + // ClientID. ClientID string timeout time.Duration @@ -68,6 +67,21 @@ type DeleteOAuth2TokenParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the delete o auth2 token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteOAuth2TokenParams) WithDefaults() *DeleteOAuth2TokenParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete o auth2 token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteOAuth2TokenParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the delete o auth2 token params func (o *DeleteOAuth2TokenParams) WithTimeout(timeout time.Duration) *DeleteOAuth2TokenParams { o.SetTimeout(timeout) @@ -124,6 +138,7 @@ func (o *DeleteOAuth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg st qrClientID := o.ClientID qClientID := qrClientID if qClientID != "" { + if err := r.SetQueryParam("client_id", qClientID); err != nil { return err } diff --git a/internal/httpclient/client/admin/delete_o_auth2_token_responses.go b/internal/httpclient/client/admin/delete_o_auth2_token_responses.go index cfbc62304a6..91bce5c7128 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_token_responses.go +++ b/internal/httpclient/client/admin/delete_o_auth2_token_responses.go @@ -41,9 +41,8 @@ func (o *DeleteOAuth2TokenReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,9 +51,9 @@ func NewDeleteOAuth2TokenNoContent() *DeleteOAuth2TokenNoContent { return &DeleteOAuth2TokenNoContent{} } -/*DeleteOAuth2TokenNoContent handles this case with default header values. +/* DeleteOAuth2TokenNoContent describes a response with status code 204, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteOAuth2TokenNoContent struct { @@ -74,7 +73,7 @@ func NewDeleteOAuth2TokenUnauthorized() *DeleteOAuth2TokenUnauthorized { return &DeleteOAuth2TokenUnauthorized{} } -/*DeleteOAuth2TokenUnauthorized handles this case with default header values. +/* DeleteOAuth2TokenUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -85,7 +84,6 @@ type DeleteOAuth2TokenUnauthorized struct { func (o *DeleteOAuth2TokenUnauthorized) Error() string { return fmt.Sprintf("[DELETE /oauth2/tokens][%d] deleteOAuth2TokenUnauthorized %+v", 401, o.Payload) } - func (o *DeleteOAuth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -107,7 +105,7 @@ func NewDeleteOAuth2TokenInternalServerError() *DeleteOAuth2TokenInternalServerE return &DeleteOAuth2TokenInternalServerError{} } -/*DeleteOAuth2TokenInternalServerError handles this case with default header values. +/* DeleteOAuth2TokenInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -118,7 +116,6 @@ type DeleteOAuth2TokenInternalServerError struct { func (o *DeleteOAuth2TokenInternalServerError) Error() string { return fmt.Sprintf("[DELETE /oauth2/tokens][%d] deleteOAuth2TokenInternalServerError %+v", 500, o.Payload) } - func (o *DeleteOAuth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go index 619a282d2bd..ae82bc9c891 100644 --- a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go +++ b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go @@ -18,51 +18,50 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewFlushInactiveOAuth2TokensParams creates a new FlushInactiveOAuth2TokensParams object -// with the default values initialized. +// NewFlushInactiveOAuth2TokensParams creates a new FlushInactiveOAuth2TokensParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewFlushInactiveOAuth2TokensParams() *FlushInactiveOAuth2TokensParams { - var () return &FlushInactiveOAuth2TokensParams{ - timeout: cr.DefaultTimeout, } } // NewFlushInactiveOAuth2TokensParamsWithTimeout creates a new FlushInactiveOAuth2TokensParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewFlushInactiveOAuth2TokensParamsWithTimeout(timeout time.Duration) *FlushInactiveOAuth2TokensParams { - var () return &FlushInactiveOAuth2TokensParams{ - timeout: timeout, } } // NewFlushInactiveOAuth2TokensParamsWithContext creates a new FlushInactiveOAuth2TokensParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewFlushInactiveOAuth2TokensParamsWithContext(ctx context.Context) *FlushInactiveOAuth2TokensParams { - var () return &FlushInactiveOAuth2TokensParams{ - Context: ctx, } } // NewFlushInactiveOAuth2TokensParamsWithHTTPClient creates a new FlushInactiveOAuth2TokensParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewFlushInactiveOAuth2TokensParamsWithHTTPClient(client *http.Client) *FlushInactiveOAuth2TokensParams { - var () return &FlushInactiveOAuth2TokensParams{ HTTPClient: client, } } -/*FlushInactiveOAuth2TokensParams contains all the parameters to send to the API endpoint -for the flush inactive o auth2 tokens operation typically these are written to a http.Request +/* FlushInactiveOAuth2TokensParams contains all the parameters to send to the API endpoint + for the flush inactive o auth2 tokens operation. + + Typically these are written to a http.Request. */ type FlushInactiveOAuth2TokensParams struct { - /*Body*/ + // Body. Body *models.FlushInactiveOAuth2TokensRequest timeout time.Duration @@ -70,6 +69,21 @@ type FlushInactiveOAuth2TokensParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the flush inactive o auth2 tokens params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *FlushInactiveOAuth2TokensParams) WithDefaults() *FlushInactiveOAuth2TokensParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the flush inactive o auth2 tokens params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *FlushInactiveOAuth2TokensParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the flush inactive o auth2 tokens params func (o *FlushInactiveOAuth2TokensParams) WithTimeout(timeout time.Duration) *FlushInactiveOAuth2TokensParams { o.SetTimeout(timeout) @@ -121,7 +135,6 @@ func (o *FlushInactiveOAuth2TokensParams) WriteToRequest(r runtime.ClientRequest return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go index 242ee437e59..7632e44e2ce 100644 --- a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go +++ b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go @@ -41,9 +41,8 @@ func (o *FlushInactiveOAuth2TokensReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,9 +51,9 @@ func NewFlushInactiveOAuth2TokensNoContent() *FlushInactiveOAuth2TokensNoContent return &FlushInactiveOAuth2TokensNoContent{} } -/*FlushInactiveOAuth2TokensNoContent handles this case with default header values. +/* FlushInactiveOAuth2TokensNoContent describes a response with status code 204, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type FlushInactiveOAuth2TokensNoContent struct { @@ -74,7 +73,7 @@ func NewFlushInactiveOAuth2TokensUnauthorized() *FlushInactiveOAuth2TokensUnauth return &FlushInactiveOAuth2TokensUnauthorized{} } -/*FlushInactiveOAuth2TokensUnauthorized handles this case with default header values. +/* FlushInactiveOAuth2TokensUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -85,7 +84,6 @@ type FlushInactiveOAuth2TokensUnauthorized struct { func (o *FlushInactiveOAuth2TokensUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/flush][%d] flushInactiveOAuth2TokensUnauthorized %+v", 401, o.Payload) } - func (o *FlushInactiveOAuth2TokensUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -107,7 +105,7 @@ func NewFlushInactiveOAuth2TokensInternalServerError() *FlushInactiveOAuth2Token return &FlushInactiveOAuth2TokensInternalServerError{} } -/*FlushInactiveOAuth2TokensInternalServerError handles this case with default header values. +/* FlushInactiveOAuth2TokensInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -118,7 +116,6 @@ type FlushInactiveOAuth2TokensInternalServerError struct { func (o *FlushInactiveOAuth2TokensInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/flush][%d] flushInactiveOAuth2TokensInternalServerError %+v", 500, o.Payload) } - func (o *FlushInactiveOAuth2TokensInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_consent_request_parameters.go b/internal/httpclient/client/admin/get_consent_request_parameters.go index 76033747908..3cdba97c4a1 100644 --- a/internal/httpclient/client/admin/get_consent_request_parameters.go +++ b/internal/httpclient/client/admin/get_consent_request_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetConsentRequestParams creates a new GetConsentRequestParams object -// with the default values initialized. +// NewGetConsentRequestParams creates a new GetConsentRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetConsentRequestParams() *GetConsentRequestParams { - var () return &GetConsentRequestParams{ - timeout: cr.DefaultTimeout, } } // NewGetConsentRequestParamsWithTimeout creates a new GetConsentRequestParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetConsentRequestParamsWithTimeout(timeout time.Duration) *GetConsentRequestParams { - var () return &GetConsentRequestParams{ - timeout: timeout, } } // NewGetConsentRequestParamsWithContext creates a new GetConsentRequestParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetConsentRequestParamsWithContext(ctx context.Context) *GetConsentRequestParams { - var () return &GetConsentRequestParams{ - Context: ctx, } } // NewGetConsentRequestParamsWithHTTPClient creates a new GetConsentRequestParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetConsentRequestParamsWithHTTPClient(client *http.Client) *GetConsentRequestParams { - var () return &GetConsentRequestParams{ HTTPClient: client, } } -/*GetConsentRequestParams contains all the parameters to send to the API endpoint -for the get consent request operation typically these are written to a http.Request +/* GetConsentRequestParams contains all the parameters to send to the API endpoint + for the get consent request operation. + + Typically these are written to a http.Request. */ type GetConsentRequestParams struct { - /*ConsentChallenge*/ + // ConsentChallenge. ConsentChallenge string timeout time.Duration @@ -68,6 +67,21 @@ type GetConsentRequestParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get consent request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConsentRequestParams) WithDefaults() *GetConsentRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get consent request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetConsentRequestParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get consent request params func (o *GetConsentRequestParams) WithTimeout(timeout time.Duration) *GetConsentRequestParams { o.SetTimeout(timeout) @@ -124,6 +138,7 @@ func (o *GetConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg st qrConsentChallenge := o.ConsentChallenge qConsentChallenge := qrConsentChallenge if qConsentChallenge != "" { + if err := r.SetQueryParam("consent_challenge", qConsentChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/get_consent_request_responses.go b/internal/httpclient/client/admin/get_consent_request_responses.go index 8a95208b137..6621dc5bd27 100644 --- a/internal/httpclient/client/admin/get_consent_request_responses.go +++ b/internal/httpclient/client/admin/get_consent_request_responses.go @@ -47,9 +47,8 @@ func (o *GetConsentRequestReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -58,7 +57,7 @@ func NewGetConsentRequestOK() *GetConsentRequestOK { return &GetConsentRequestOK{} } -/*GetConsentRequestOK handles this case with default header values. +/* GetConsentRequestOK describes a response with status code 200, with default header values. consentRequest */ @@ -69,7 +68,6 @@ type GetConsentRequestOK struct { func (o *GetConsentRequestOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestOK %+v", 200, o.Payload) } - func (o *GetConsentRequestOK) GetPayload() *models.ConsentRequest { return o.Payload } @@ -91,7 +89,7 @@ func NewGetConsentRequestNotFound() *GetConsentRequestNotFound { return &GetConsentRequestNotFound{} } -/*GetConsentRequestNotFound handles this case with default header values. +/* GetConsentRequestNotFound describes a response with status code 404, with default header values. jsonError */ @@ -102,7 +100,6 @@ type GetConsentRequestNotFound struct { func (o *GetConsentRequestNotFound) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestNotFound %+v", 404, o.Payload) } - func (o *GetConsentRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -124,7 +121,7 @@ func NewGetConsentRequestGone() *GetConsentRequestGone { return &GetConsentRequestGone{} } -/*GetConsentRequestGone handles this case with default header values. +/* GetConsentRequestGone describes a response with status code 410, with default header values. requestWasHandledResponse */ @@ -135,7 +132,6 @@ type GetConsentRequestGone struct { func (o *GetConsentRequestGone) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestGone %+v", 410, o.Payload) } - func (o *GetConsentRequestGone) GetPayload() *models.RequestWasHandledResponse { return o.Payload } @@ -157,7 +153,7 @@ func NewGetConsentRequestInternalServerError() *GetConsentRequestInternalServerE return &GetConsentRequestInternalServerError{} } -/*GetConsentRequestInternalServerError handles this case with default header values. +/* GetConsentRequestInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -168,7 +164,6 @@ type GetConsentRequestInternalServerError struct { func (o *GetConsentRequestInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestInternalServerError %+v", 500, o.Payload) } - func (o *GetConsentRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_json_web_key_parameters.go b/internal/httpclient/client/admin/get_json_web_key_parameters.go index c8c609b8695..bf7429056e8 100644 --- a/internal/httpclient/client/admin/get_json_web_key_parameters.go +++ b/internal/httpclient/client/admin/get_json_web_key_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetJSONWebKeyParams creates a new GetJSONWebKeyParams object -// with the default values initialized. +// NewGetJSONWebKeyParams creates a new GetJSONWebKeyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetJSONWebKeyParams() *GetJSONWebKeyParams { - var () return &GetJSONWebKeyParams{ - timeout: cr.DefaultTimeout, } } // NewGetJSONWebKeyParamsWithTimeout creates a new GetJSONWebKeyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetJSONWebKeyParamsWithTimeout(timeout time.Duration) *GetJSONWebKeyParams { - var () return &GetJSONWebKeyParams{ - timeout: timeout, } } // NewGetJSONWebKeyParamsWithContext creates a new GetJSONWebKeyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetJSONWebKeyParamsWithContext(ctx context.Context) *GetJSONWebKeyParams { - var () return &GetJSONWebKeyParams{ - Context: ctx, } } // NewGetJSONWebKeyParamsWithHTTPClient creates a new GetJSONWebKeyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetJSONWebKeyParamsWithHTTPClient(client *http.Client) *GetJSONWebKeyParams { - var () return &GetJSONWebKeyParams{ HTTPClient: client, } } -/*GetJSONWebKeyParams contains all the parameters to send to the API endpoint -for the get Json web key operation typically these are written to a http.Request +/* GetJSONWebKeyParams contains all the parameters to send to the API endpoint + for the get Json web key operation. + + Typically these are written to a http.Request. */ type GetJSONWebKeyParams struct { - /*Kid - The kid of the desired key + /* Kid. + The kid of the desired key */ Kid string - /*Set - The set + /* Set. + + The set */ Set string @@ -76,6 +76,21 @@ type GetJSONWebKeyParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get Json web key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJSONWebKeyParams) WithDefaults() *GetJSONWebKeyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get Json web key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJSONWebKeyParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get Json web key params func (o *GetJSONWebKeyParams) WithTimeout(timeout time.Duration) *GetJSONWebKeyParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_json_web_key_responses.go b/internal/httpclient/client/admin/get_json_web_key_responses.go index 16951135c77..2a0c4c2e50d 100644 --- a/internal/httpclient/client/admin/get_json_web_key_responses.go +++ b/internal/httpclient/client/admin/get_json_web_key_responses.go @@ -41,9 +41,8 @@ func (o *GetJSONWebKeyReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewGetJSONWebKeyOK() *GetJSONWebKeyOK { return &GetJSONWebKeyOK{} } -/*GetJSONWebKeyOK handles this case with default header values. +/* GetJSONWebKeyOK describes a response with status code 200, with default header values. JSONWebKeySet */ @@ -63,7 +62,6 @@ type GetJSONWebKeyOK struct { func (o *GetJSONWebKeyOK) Error() string { return fmt.Sprintf("[GET /keys/{set}/{kid}][%d] getJsonWebKeyOK %+v", 200, o.Payload) } - func (o *GetJSONWebKeyOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -85,7 +83,7 @@ func NewGetJSONWebKeyNotFound() *GetJSONWebKeyNotFound { return &GetJSONWebKeyNotFound{} } -/*GetJSONWebKeyNotFound handles this case with default header values. +/* GetJSONWebKeyNotFound describes a response with status code 404, with default header values. jsonError */ @@ -96,7 +94,6 @@ type GetJSONWebKeyNotFound struct { func (o *GetJSONWebKeyNotFound) Error() string { return fmt.Sprintf("[GET /keys/{set}/{kid}][%d] getJsonWebKeyNotFound %+v", 404, o.Payload) } - func (o *GetJSONWebKeyNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -118,7 +115,7 @@ func NewGetJSONWebKeyInternalServerError() *GetJSONWebKeyInternalServerError { return &GetJSONWebKeyInternalServerError{} } -/*GetJSONWebKeyInternalServerError handles this case with default header values. +/* GetJSONWebKeyInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -129,7 +126,6 @@ type GetJSONWebKeyInternalServerError struct { func (o *GetJSONWebKeyInternalServerError) Error() string { return fmt.Sprintf("[GET /keys/{set}/{kid}][%d] getJsonWebKeyInternalServerError %+v", 500, o.Payload) } - func (o *GetJSONWebKeyInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_json_web_key_set_parameters.go b/internal/httpclient/client/admin/get_json_web_key_set_parameters.go index 34dee113c0d..1635ddb667d 100644 --- a/internal/httpclient/client/admin/get_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/get_json_web_key_set_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetJSONWebKeySetParams creates a new GetJSONWebKeySetParams object -// with the default values initialized. +// NewGetJSONWebKeySetParams creates a new GetJSONWebKeySetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetJSONWebKeySetParams() *GetJSONWebKeySetParams { - var () return &GetJSONWebKeySetParams{ - timeout: cr.DefaultTimeout, } } // NewGetJSONWebKeySetParamsWithTimeout creates a new GetJSONWebKeySetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetJSONWebKeySetParamsWithTimeout(timeout time.Duration) *GetJSONWebKeySetParams { - var () return &GetJSONWebKeySetParams{ - timeout: timeout, } } // NewGetJSONWebKeySetParamsWithContext creates a new GetJSONWebKeySetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetJSONWebKeySetParamsWithContext(ctx context.Context) *GetJSONWebKeySetParams { - var () return &GetJSONWebKeySetParams{ - Context: ctx, } } // NewGetJSONWebKeySetParamsWithHTTPClient creates a new GetJSONWebKeySetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetJSONWebKeySetParamsWithHTTPClient(client *http.Client) *GetJSONWebKeySetParams { - var () return &GetJSONWebKeySetParams{ HTTPClient: client, } } -/*GetJSONWebKeySetParams contains all the parameters to send to the API endpoint -for the get Json web key set operation typically these are written to a http.Request +/* GetJSONWebKeySetParams contains all the parameters to send to the API endpoint + for the get Json web key set operation. + + Typically these are written to a http.Request. */ type GetJSONWebKeySetParams struct { - /*Set - The set + /* Set. + The set */ Set string @@ -71,6 +70,21 @@ type GetJSONWebKeySetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get Json web key set params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJSONWebKeySetParams) WithDefaults() *GetJSONWebKeySetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get Json web key set params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetJSONWebKeySetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get Json web key set params func (o *GetJSONWebKeySetParams) WithTimeout(timeout time.Duration) *GetJSONWebKeySetParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_json_web_key_set_responses.go b/internal/httpclient/client/admin/get_json_web_key_set_responses.go index 3c04c72704c..071a09ee356 100644 --- a/internal/httpclient/client/admin/get_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/get_json_web_key_set_responses.go @@ -47,9 +47,8 @@ func (o *GetJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -58,7 +57,7 @@ func NewGetJSONWebKeySetOK() *GetJSONWebKeySetOK { return &GetJSONWebKeySetOK{} } -/*GetJSONWebKeySetOK handles this case with default header values. +/* GetJSONWebKeySetOK describes a response with status code 200, with default header values. JSONWebKeySet */ @@ -69,7 +68,6 @@ type GetJSONWebKeySetOK struct { func (o *GetJSONWebKeySetOK) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetOK %+v", 200, o.Payload) } - func (o *GetJSONWebKeySetOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -91,7 +89,7 @@ func NewGetJSONWebKeySetUnauthorized() *GetJSONWebKeySetUnauthorized { return &GetJSONWebKeySetUnauthorized{} } -/*GetJSONWebKeySetUnauthorized handles this case with default header values. +/* GetJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -102,7 +100,6 @@ type GetJSONWebKeySetUnauthorized struct { func (o *GetJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetUnauthorized %+v", 401, o.Payload) } - func (o *GetJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -124,7 +121,7 @@ func NewGetJSONWebKeySetForbidden() *GetJSONWebKeySetForbidden { return &GetJSONWebKeySetForbidden{} } -/*GetJSONWebKeySetForbidden handles this case with default header values. +/* GetJSONWebKeySetForbidden describes a response with status code 403, with default header values. jsonError */ @@ -135,7 +132,6 @@ type GetJSONWebKeySetForbidden struct { func (o *GetJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetForbidden %+v", 403, o.Payload) } - func (o *GetJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -157,7 +153,7 @@ func NewGetJSONWebKeySetInternalServerError() *GetJSONWebKeySetInternalServerErr return &GetJSONWebKeySetInternalServerError{} } -/*GetJSONWebKeySetInternalServerError handles this case with default header values. +/* GetJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -168,7 +164,6 @@ type GetJSONWebKeySetInternalServerError struct { func (o *GetJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetInternalServerError %+v", 500, o.Payload) } - func (o *GetJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_login_request_parameters.go b/internal/httpclient/client/admin/get_login_request_parameters.go index 32ce4b750f3..55a3dae116f 100644 --- a/internal/httpclient/client/admin/get_login_request_parameters.go +++ b/internal/httpclient/client/admin/get_login_request_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLoginRequestParams creates a new GetLoginRequestParams object -// with the default values initialized. +// NewGetLoginRequestParams creates a new GetLoginRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetLoginRequestParams() *GetLoginRequestParams { - var () return &GetLoginRequestParams{ - timeout: cr.DefaultTimeout, } } // NewGetLoginRequestParamsWithTimeout creates a new GetLoginRequestParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetLoginRequestParamsWithTimeout(timeout time.Duration) *GetLoginRequestParams { - var () return &GetLoginRequestParams{ - timeout: timeout, } } // NewGetLoginRequestParamsWithContext creates a new GetLoginRequestParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetLoginRequestParamsWithContext(ctx context.Context) *GetLoginRequestParams { - var () return &GetLoginRequestParams{ - Context: ctx, } } // NewGetLoginRequestParamsWithHTTPClient creates a new GetLoginRequestParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetLoginRequestParamsWithHTTPClient(client *http.Client) *GetLoginRequestParams { - var () return &GetLoginRequestParams{ HTTPClient: client, } } -/*GetLoginRequestParams contains all the parameters to send to the API endpoint -for the get login request operation typically these are written to a http.Request +/* GetLoginRequestParams contains all the parameters to send to the API endpoint + for the get login request operation. + + Typically these are written to a http.Request. */ type GetLoginRequestParams struct { - /*LoginChallenge*/ + // LoginChallenge. LoginChallenge string timeout time.Duration @@ -68,6 +67,21 @@ type GetLoginRequestParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get login request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoginRequestParams) WithDefaults() *GetLoginRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get login request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLoginRequestParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get login request params func (o *GetLoginRequestParams) WithTimeout(timeout time.Duration) *GetLoginRequestParams { o.SetTimeout(timeout) @@ -124,6 +138,7 @@ func (o *GetLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg strf qrLoginChallenge := o.LoginChallenge qLoginChallenge := qrLoginChallenge if qLoginChallenge != "" { + if err := r.SetQueryParam("login_challenge", qLoginChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/get_login_request_responses.go b/internal/httpclient/client/admin/get_login_request_responses.go index 57221a73d49..4eaddfbf39f 100644 --- a/internal/httpclient/client/admin/get_login_request_responses.go +++ b/internal/httpclient/client/admin/get_login_request_responses.go @@ -53,9 +53,8 @@ func (o *GetLoginRequestReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -64,7 +63,7 @@ func NewGetLoginRequestOK() *GetLoginRequestOK { return &GetLoginRequestOK{} } -/*GetLoginRequestOK handles this case with default header values. +/* GetLoginRequestOK describes a response with status code 200, with default header values. loginRequest */ @@ -75,7 +74,6 @@ type GetLoginRequestOK struct { func (o *GetLoginRequestOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestOK %+v", 200, o.Payload) } - func (o *GetLoginRequestOK) GetPayload() *models.LoginRequest { return o.Payload } @@ -97,7 +95,7 @@ func NewGetLoginRequestBadRequest() *GetLoginRequestBadRequest { return &GetLoginRequestBadRequest{} } -/*GetLoginRequestBadRequest handles this case with default header values. +/* GetLoginRequestBadRequest describes a response with status code 400, with default header values. jsonError */ @@ -108,7 +106,6 @@ type GetLoginRequestBadRequest struct { func (o *GetLoginRequestBadRequest) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestBadRequest %+v", 400, o.Payload) } - func (o *GetLoginRequestBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -130,7 +127,7 @@ func NewGetLoginRequestNotFound() *GetLoginRequestNotFound { return &GetLoginRequestNotFound{} } -/*GetLoginRequestNotFound handles this case with default header values. +/* GetLoginRequestNotFound describes a response with status code 404, with default header values. jsonError */ @@ -141,7 +138,6 @@ type GetLoginRequestNotFound struct { func (o *GetLoginRequestNotFound) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestNotFound %+v", 404, o.Payload) } - func (o *GetLoginRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -163,7 +159,7 @@ func NewGetLoginRequestGone() *GetLoginRequestGone { return &GetLoginRequestGone{} } -/*GetLoginRequestGone handles this case with default header values. +/* GetLoginRequestGone describes a response with status code 410, with default header values. requestWasHandledResponse */ @@ -174,7 +170,6 @@ type GetLoginRequestGone struct { func (o *GetLoginRequestGone) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestGone %+v", 410, o.Payload) } - func (o *GetLoginRequestGone) GetPayload() *models.RequestWasHandledResponse { return o.Payload } @@ -196,7 +191,7 @@ func NewGetLoginRequestInternalServerError() *GetLoginRequestInternalServerError return &GetLoginRequestInternalServerError{} } -/*GetLoginRequestInternalServerError handles this case with default header values. +/* GetLoginRequestInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -207,7 +202,6 @@ type GetLoginRequestInternalServerError struct { func (o *GetLoginRequestInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestInternalServerError %+v", 500, o.Payload) } - func (o *GetLoginRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_logout_request_parameters.go b/internal/httpclient/client/admin/get_logout_request_parameters.go index 27ed8793be3..97cf9f7e4bc 100644 --- a/internal/httpclient/client/admin/get_logout_request_parameters.go +++ b/internal/httpclient/client/admin/get_logout_request_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLogoutRequestParams creates a new GetLogoutRequestParams object -// with the default values initialized. +// NewGetLogoutRequestParams creates a new GetLogoutRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetLogoutRequestParams() *GetLogoutRequestParams { - var () return &GetLogoutRequestParams{ - timeout: cr.DefaultTimeout, } } // NewGetLogoutRequestParamsWithTimeout creates a new GetLogoutRequestParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetLogoutRequestParamsWithTimeout(timeout time.Duration) *GetLogoutRequestParams { - var () return &GetLogoutRequestParams{ - timeout: timeout, } } // NewGetLogoutRequestParamsWithContext creates a new GetLogoutRequestParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetLogoutRequestParamsWithContext(ctx context.Context) *GetLogoutRequestParams { - var () return &GetLogoutRequestParams{ - Context: ctx, } } // NewGetLogoutRequestParamsWithHTTPClient creates a new GetLogoutRequestParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetLogoutRequestParamsWithHTTPClient(client *http.Client) *GetLogoutRequestParams { - var () return &GetLogoutRequestParams{ HTTPClient: client, } } -/*GetLogoutRequestParams contains all the parameters to send to the API endpoint -for the get logout request operation typically these are written to a http.Request +/* GetLogoutRequestParams contains all the parameters to send to the API endpoint + for the get logout request operation. + + Typically these are written to a http.Request. */ type GetLogoutRequestParams struct { - /*LogoutChallenge*/ + // LogoutChallenge. LogoutChallenge string timeout time.Duration @@ -68,6 +67,21 @@ type GetLogoutRequestParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get logout request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLogoutRequestParams) WithDefaults() *GetLogoutRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get logout request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetLogoutRequestParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get logout request params func (o *GetLogoutRequestParams) WithTimeout(timeout time.Duration) *GetLogoutRequestParams { o.SetTimeout(timeout) @@ -124,6 +138,7 @@ func (o *GetLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg str qrLogoutChallenge := o.LogoutChallenge qLogoutChallenge := qrLogoutChallenge if qLogoutChallenge != "" { + if err := r.SetQueryParam("logout_challenge", qLogoutChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/get_logout_request_responses.go b/internal/httpclient/client/admin/get_logout_request_responses.go index 9d708a06795..0b6448c101b 100644 --- a/internal/httpclient/client/admin/get_logout_request_responses.go +++ b/internal/httpclient/client/admin/get_logout_request_responses.go @@ -47,9 +47,8 @@ func (o *GetLogoutRequestReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -58,7 +57,7 @@ func NewGetLogoutRequestOK() *GetLogoutRequestOK { return &GetLogoutRequestOK{} } -/*GetLogoutRequestOK handles this case with default header values. +/* GetLogoutRequestOK describes a response with status code 200, with default header values. logoutRequest */ @@ -69,7 +68,6 @@ type GetLogoutRequestOK struct { func (o *GetLogoutRequestOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestOK %+v", 200, o.Payload) } - func (o *GetLogoutRequestOK) GetPayload() *models.LogoutRequest { return o.Payload } @@ -91,7 +89,7 @@ func NewGetLogoutRequestNotFound() *GetLogoutRequestNotFound { return &GetLogoutRequestNotFound{} } -/*GetLogoutRequestNotFound handles this case with default header values. +/* GetLogoutRequestNotFound describes a response with status code 404, with default header values. jsonError */ @@ -102,7 +100,6 @@ type GetLogoutRequestNotFound struct { func (o *GetLogoutRequestNotFound) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestNotFound %+v", 404, o.Payload) } - func (o *GetLogoutRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -124,7 +121,7 @@ func NewGetLogoutRequestGone() *GetLogoutRequestGone { return &GetLogoutRequestGone{} } -/*GetLogoutRequestGone handles this case with default header values. +/* GetLogoutRequestGone describes a response with status code 410, with default header values. requestWasHandledResponse */ @@ -135,7 +132,6 @@ type GetLogoutRequestGone struct { func (o *GetLogoutRequestGone) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestGone %+v", 410, o.Payload) } - func (o *GetLogoutRequestGone) GetPayload() *models.RequestWasHandledResponse { return o.Payload } @@ -157,7 +153,7 @@ func NewGetLogoutRequestInternalServerError() *GetLogoutRequestInternalServerErr return &GetLogoutRequestInternalServerError{} } -/*GetLogoutRequestInternalServerError handles this case with default header values. +/* GetLogoutRequestInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -168,7 +164,6 @@ type GetLogoutRequestInternalServerError struct { func (o *GetLogoutRequestInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestInternalServerError %+v", 500, o.Payload) } - func (o *GetLogoutRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_o_auth2_client_parameters.go b/internal/httpclient/client/admin/get_o_auth2_client_parameters.go index ea7cb067357..f9af2c1f16f 100644 --- a/internal/httpclient/client/admin/get_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/get_o_auth2_client_parameters.go @@ -16,53 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetOAuth2ClientParams creates a new GetOAuth2ClientParams object -// with the default values initialized. +// NewGetOAuth2ClientParams creates a new GetOAuth2ClientParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetOAuth2ClientParams() *GetOAuth2ClientParams { - var () return &GetOAuth2ClientParams{ - timeout: cr.DefaultTimeout, } } // NewGetOAuth2ClientParamsWithTimeout creates a new GetOAuth2ClientParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetOAuth2ClientParamsWithTimeout(timeout time.Duration) *GetOAuth2ClientParams { - var () return &GetOAuth2ClientParams{ - timeout: timeout, } } // NewGetOAuth2ClientParamsWithContext creates a new GetOAuth2ClientParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetOAuth2ClientParamsWithContext(ctx context.Context) *GetOAuth2ClientParams { - var () return &GetOAuth2ClientParams{ - Context: ctx, } } // NewGetOAuth2ClientParamsWithHTTPClient creates a new GetOAuth2ClientParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetOAuth2ClientParamsWithHTTPClient(client *http.Client) *GetOAuth2ClientParams { - var () return &GetOAuth2ClientParams{ HTTPClient: client, } } -/*GetOAuth2ClientParams contains all the parameters to send to the API endpoint -for the get o auth2 client operation typically these are written to a http.Request +/* GetOAuth2ClientParams contains all the parameters to send to the API endpoint + for the get o auth2 client operation. + + Typically these are written to a http.Request. */ type GetOAuth2ClientParams struct { - /*ID - The id of the OAuth 2.0 Client. + /* ID. + The id of the OAuth 2.0 Client. */ ID string @@ -71,6 +70,21 @@ type GetOAuth2ClientParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOAuth2ClientParams) WithDefaults() *GetOAuth2ClientParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOAuth2ClientParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get o auth2 client params func (o *GetOAuth2ClientParams) WithTimeout(timeout time.Duration) *GetOAuth2ClientParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_o_auth2_client_responses.go b/internal/httpclient/client/admin/get_o_auth2_client_responses.go index 1f156792a72..f00e4038c4d 100644 --- a/internal/httpclient/client/admin/get_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/get_o_auth2_client_responses.go @@ -41,9 +41,8 @@ func (o *GetOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewGetOAuth2ClientOK() *GetOAuth2ClientOK { return &GetOAuth2ClientOK{} } -/*GetOAuth2ClientOK handles this case with default header values. +/* GetOAuth2ClientOK describes a response with status code 200, with default header values. oAuth2Client */ @@ -63,7 +62,6 @@ type GetOAuth2ClientOK struct { func (o *GetOAuth2ClientOK) Error() string { return fmt.Sprintf("[GET /clients/{id}][%d] getOAuth2ClientOK %+v", 200, o.Payload) } - func (o *GetOAuth2ClientOK) GetPayload() *models.OAuth2Client { return o.Payload } @@ -85,7 +83,7 @@ func NewGetOAuth2ClientUnauthorized() *GetOAuth2ClientUnauthorized { return &GetOAuth2ClientUnauthorized{} } -/*GetOAuth2ClientUnauthorized handles this case with default header values. +/* GetOAuth2ClientUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -96,7 +94,6 @@ type GetOAuth2ClientUnauthorized struct { func (o *GetOAuth2ClientUnauthorized) Error() string { return fmt.Sprintf("[GET /clients/{id}][%d] getOAuth2ClientUnauthorized %+v", 401, o.Payload) } - func (o *GetOAuth2ClientUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -118,7 +115,7 @@ func NewGetOAuth2ClientInternalServerError() *GetOAuth2ClientInternalServerError return &GetOAuth2ClientInternalServerError{} } -/*GetOAuth2ClientInternalServerError handles this case with default header values. +/* GetOAuth2ClientInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -129,7 +126,6 @@ type GetOAuth2ClientInternalServerError struct { func (o *GetOAuth2ClientInternalServerError) Error() string { return fmt.Sprintf("[GET /clients/{id}][%d] getOAuth2ClientInternalServerError %+v", 500, o.Payload) } - func (o *GetOAuth2ClientInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_version_parameters.go b/internal/httpclient/client/admin/get_version_parameters.go index 24417d3a303..56746becb66 100644 --- a/internal/httpclient/client/admin/get_version_parameters.go +++ b/internal/httpclient/client/admin/get_version_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVersionParams creates a new GetVersionParams object -// with the default values initialized. +// NewGetVersionParams creates a new GetVersionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewGetVersionParams() *GetVersionParams { - return &GetVersionParams{ - timeout: cr.DefaultTimeout, } } // NewGetVersionParamsWithTimeout creates a new GetVersionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewGetVersionParamsWithTimeout(timeout time.Duration) *GetVersionParams { - return &GetVersionParams{ - timeout: timeout, } } // NewGetVersionParamsWithContext creates a new GetVersionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewGetVersionParamsWithContext(ctx context.Context) *GetVersionParams { - return &GetVersionParams{ - Context: ctx, } } // NewGetVersionParamsWithHTTPClient creates a new GetVersionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewGetVersionParamsWithHTTPClient(client *http.Client) *GetVersionParams { - return &GetVersionParams{ HTTPClient: client, } } -/*GetVersionParams contains all the parameters to send to the API endpoint -for the get version operation typically these are written to a http.Request +/* GetVersionParams contains all the parameters to send to the API endpoint + for the get version operation. + + Typically these are written to a http.Request. */ type GetVersionParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type GetVersionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the get version params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVersionParams) WithDefaults() *GetVersionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get version params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVersionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the get version params func (o *GetVersionParams) WithTimeout(timeout time.Duration) *GetVersionParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_version_responses.go b/internal/httpclient/client/admin/get_version_responses.go index 1755c1707da..55510cd6c00 100644 --- a/internal/httpclient/client/admin/get_version_responses.go +++ b/internal/httpclient/client/admin/get_version_responses.go @@ -29,9 +29,8 @@ func (o *GetVersionReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return result, nil - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -40,7 +39,7 @@ func NewGetVersionOK() *GetVersionOK { return &GetVersionOK{} } -/*GetVersionOK handles this case with default header values. +/* GetVersionOK describes a response with status code 200, with default header values. version */ @@ -51,7 +50,6 @@ type GetVersionOK struct { func (o *GetVersionOK) Error() string { return fmt.Sprintf("[GET /version][%d] getVersionOK %+v", 200, o.Payload) } - func (o *GetVersionOK) GetPayload() *models.Version { return o.Payload } diff --git a/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go b/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go index 3913438d85d..c1addcfac03 100644 --- a/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go +++ b/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go @@ -16,62 +16,62 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIntrospectOAuth2TokenParams creates a new IntrospectOAuth2TokenParams object -// with the default values initialized. +// NewIntrospectOAuth2TokenParams creates a new IntrospectOAuth2TokenParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewIntrospectOAuth2TokenParams() *IntrospectOAuth2TokenParams { - var () return &IntrospectOAuth2TokenParams{ - timeout: cr.DefaultTimeout, } } // NewIntrospectOAuth2TokenParamsWithTimeout creates a new IntrospectOAuth2TokenParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewIntrospectOAuth2TokenParamsWithTimeout(timeout time.Duration) *IntrospectOAuth2TokenParams { - var () return &IntrospectOAuth2TokenParams{ - timeout: timeout, } } // NewIntrospectOAuth2TokenParamsWithContext creates a new IntrospectOAuth2TokenParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewIntrospectOAuth2TokenParamsWithContext(ctx context.Context) *IntrospectOAuth2TokenParams { - var () return &IntrospectOAuth2TokenParams{ - Context: ctx, } } // NewIntrospectOAuth2TokenParamsWithHTTPClient creates a new IntrospectOAuth2TokenParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewIntrospectOAuth2TokenParamsWithHTTPClient(client *http.Client) *IntrospectOAuth2TokenParams { - var () return &IntrospectOAuth2TokenParams{ HTTPClient: client, } } -/*IntrospectOAuth2TokenParams contains all the parameters to send to the API endpoint -for the introspect o auth2 token operation typically these are written to a http.Request +/* IntrospectOAuth2TokenParams contains all the parameters to send to the API endpoint + for the introspect o auth2 token operation. + + Typically these are written to a http.Request. */ type IntrospectOAuth2TokenParams struct { - /*Scope - An optional, space separated list of required scopes. If the access token was not granted one of the - scopes, the result of active will be false. + /* Scope. + An optional, space separated list of required scopes. If the access token was not granted one of the + scopes, the result of active will be false. */ Scope *string - /*Token - The string value of the token. For access tokens, this + + /* Token. + + The string value of the token. For access tokens, this is the "access_token" value returned from the token endpoint defined in OAuth 2.0. For refresh tokens, this is the "refresh_token" value returned. - */ Token string @@ -80,6 +80,21 @@ type IntrospectOAuth2TokenParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the introspect o auth2 token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IntrospectOAuth2TokenParams) WithDefaults() *IntrospectOAuth2TokenParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the introspect o auth2 token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IntrospectOAuth2TokenParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the introspect o auth2 token params func (o *IntrospectOAuth2TokenParams) WithTimeout(timeout time.Duration) *IntrospectOAuth2TokenParams { o.SetTimeout(timeout) @@ -156,7 +171,6 @@ func (o *IntrospectOAuth2TokenParams) WriteToRequest(r runtime.ClientRequest, re return err } } - } // form param token diff --git a/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go b/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go index 5dff4abf68e..8ea409176f7 100644 --- a/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go +++ b/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go @@ -41,9 +41,8 @@ func (o *IntrospectOAuth2TokenReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewIntrospectOAuth2TokenOK() *IntrospectOAuth2TokenOK { return &IntrospectOAuth2TokenOK{} } -/*IntrospectOAuth2TokenOK handles this case with default header values. +/* IntrospectOAuth2TokenOK describes a response with status code 200, with default header values. oAuth2TokenIntrospection */ @@ -63,7 +62,6 @@ type IntrospectOAuth2TokenOK struct { func (o *IntrospectOAuth2TokenOK) Error() string { return fmt.Sprintf("[POST /oauth2/introspect][%d] introspectOAuth2TokenOK %+v", 200, o.Payload) } - func (o *IntrospectOAuth2TokenOK) GetPayload() *models.OAuth2TokenIntrospection { return o.Payload } @@ -85,7 +83,7 @@ func NewIntrospectOAuth2TokenUnauthorized() *IntrospectOAuth2TokenUnauthorized { return &IntrospectOAuth2TokenUnauthorized{} } -/*IntrospectOAuth2TokenUnauthorized handles this case with default header values. +/* IntrospectOAuth2TokenUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -96,7 +94,6 @@ type IntrospectOAuth2TokenUnauthorized struct { func (o *IntrospectOAuth2TokenUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/introspect][%d] introspectOAuth2TokenUnauthorized %+v", 401, o.Payload) } - func (o *IntrospectOAuth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -118,7 +115,7 @@ func NewIntrospectOAuth2TokenInternalServerError() *IntrospectOAuth2TokenInterna return &IntrospectOAuth2TokenInternalServerError{} } -/*IntrospectOAuth2TokenInternalServerError handles this case with default header values. +/* IntrospectOAuth2TokenInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -129,7 +126,6 @@ type IntrospectOAuth2TokenInternalServerError struct { func (o *IntrospectOAuth2TokenInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/introspect][%d] introspectOAuth2TokenInternalServerError %+v", 500, o.Payload) } - func (o *IntrospectOAuth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/is_instance_alive_parameters.go b/internal/httpclient/client/admin/is_instance_alive_parameters.go index 44c9c204fe3..50766f53d7e 100644 --- a/internal/httpclient/client/admin/is_instance_alive_parameters.go +++ b/internal/httpclient/client/admin/is_instance_alive_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIsInstanceAliveParams creates a new IsInstanceAliveParams object -// with the default values initialized. +// NewIsInstanceAliveParams creates a new IsInstanceAliveParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewIsInstanceAliveParams() *IsInstanceAliveParams { - return &IsInstanceAliveParams{ - timeout: cr.DefaultTimeout, } } // NewIsInstanceAliveParamsWithTimeout creates a new IsInstanceAliveParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewIsInstanceAliveParamsWithTimeout(timeout time.Duration) *IsInstanceAliveParams { - return &IsInstanceAliveParams{ - timeout: timeout, } } // NewIsInstanceAliveParamsWithContext creates a new IsInstanceAliveParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewIsInstanceAliveParamsWithContext(ctx context.Context) *IsInstanceAliveParams { - return &IsInstanceAliveParams{ - Context: ctx, } } // NewIsInstanceAliveParamsWithHTTPClient creates a new IsInstanceAliveParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewIsInstanceAliveParamsWithHTTPClient(client *http.Client) *IsInstanceAliveParams { - return &IsInstanceAliveParams{ HTTPClient: client, } } -/*IsInstanceAliveParams contains all the parameters to send to the API endpoint -for the is instance alive operation typically these are written to a http.Request +/* IsInstanceAliveParams contains all the parameters to send to the API endpoint + for the is instance alive operation. + + Typically these are written to a http.Request. */ type IsInstanceAliveParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type IsInstanceAliveParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the is instance alive params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IsInstanceAliveParams) WithDefaults() *IsInstanceAliveParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the is instance alive params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IsInstanceAliveParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the is instance alive params func (o *IsInstanceAliveParams) WithTimeout(timeout time.Duration) *IsInstanceAliveParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/is_instance_alive_responses.go b/internal/httpclient/client/admin/is_instance_alive_responses.go index ddf10ab1b45..fd1036d01fb 100644 --- a/internal/httpclient/client/admin/is_instance_alive_responses.go +++ b/internal/httpclient/client/admin/is_instance_alive_responses.go @@ -35,9 +35,8 @@ func (o *IsInstanceAliveReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -46,7 +45,7 @@ func NewIsInstanceAliveOK() *IsInstanceAliveOK { return &IsInstanceAliveOK{} } -/*IsInstanceAliveOK handles this case with default header values. +/* IsInstanceAliveOK describes a response with status code 200, with default header values. healthStatus */ @@ -57,7 +56,6 @@ type IsInstanceAliveOK struct { func (o *IsInstanceAliveOK) Error() string { return fmt.Sprintf("[GET /health/alive][%d] isInstanceAliveOK %+v", 200, o.Payload) } - func (o *IsInstanceAliveOK) GetPayload() *models.HealthStatus { return o.Payload } @@ -79,7 +77,7 @@ func NewIsInstanceAliveInternalServerError() *IsInstanceAliveInternalServerError return &IsInstanceAliveInternalServerError{} } -/*IsInstanceAliveInternalServerError handles this case with default header values. +/* IsInstanceAliveInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -90,7 +88,6 @@ type IsInstanceAliveInternalServerError struct { func (o *IsInstanceAliveInternalServerError) Error() string { return fmt.Sprintf("[GET /health/alive][%d] isInstanceAliveInternalServerError %+v", 500, o.Payload) } - func (o *IsInstanceAliveInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/list_o_auth2_clients_parameters.go b/internal/httpclient/client/admin/list_o_auth2_clients_parameters.go index 6d3e6684d63..c9b73dab8a0 100644 --- a/internal/httpclient/client/admin/list_o_auth2_clients_parameters.go +++ b/internal/httpclient/client/admin/list_o_auth2_clients_parameters.go @@ -17,58 +17,62 @@ import ( "github.com/go-openapi/swag" ) -// NewListOAuth2ClientsParams creates a new ListOAuth2ClientsParams object -// with the default values initialized. +// NewListOAuth2ClientsParams creates a new ListOAuth2ClientsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewListOAuth2ClientsParams() *ListOAuth2ClientsParams { - var () return &ListOAuth2ClientsParams{ - timeout: cr.DefaultTimeout, } } // NewListOAuth2ClientsParamsWithTimeout creates a new ListOAuth2ClientsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListOAuth2ClientsParamsWithTimeout(timeout time.Duration) *ListOAuth2ClientsParams { - var () return &ListOAuth2ClientsParams{ - timeout: timeout, } } // NewListOAuth2ClientsParamsWithContext creates a new ListOAuth2ClientsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListOAuth2ClientsParamsWithContext(ctx context.Context) *ListOAuth2ClientsParams { - var () return &ListOAuth2ClientsParams{ - Context: ctx, } } // NewListOAuth2ClientsParamsWithHTTPClient creates a new ListOAuth2ClientsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListOAuth2ClientsParamsWithHTTPClient(client *http.Client) *ListOAuth2ClientsParams { - var () return &ListOAuth2ClientsParams{ HTTPClient: client, } } -/*ListOAuth2ClientsParams contains all the parameters to send to the API endpoint -for the list o auth2 clients operation typically these are written to a http.Request +/* ListOAuth2ClientsParams contains all the parameters to send to the API endpoint + for the list o auth2 clients operation. + + Typically these are written to a http.Request. */ type ListOAuth2ClientsParams struct { - /*Limit - The maximum amount of policies returned, upper bound is 500 policies + /* Limit. + + The maximum amount of policies returned, upper bound is 500 policies + Format: int64 */ Limit *int64 - /*Offset - The offset from where to start looking. + /* Offset. + + The offset from where to start looking. + + Format: int64 */ Offset *int64 @@ -77,6 +81,21 @@ type ListOAuth2ClientsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list o auth2 clients params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListOAuth2ClientsParams) WithDefaults() *ListOAuth2ClientsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list o auth2 clients params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListOAuth2ClientsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list o auth2 clients params func (o *ListOAuth2ClientsParams) WithTimeout(timeout time.Duration) *ListOAuth2ClientsParams { o.SetTimeout(timeout) @@ -144,32 +163,34 @@ func (o *ListOAuth2ClientsParams) WriteToRequest(r runtime.ClientRequest, reg st // query param limit var qrLimit int64 + if o.Limit != nil { qrLimit = *o.Limit } qLimit := swag.FormatInt64(qrLimit) if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { return err } } - } if o.Offset != nil { // query param offset var qrOffset int64 + if o.Offset != nil { qrOffset = *o.Offset } qOffset := swag.FormatInt64(qrOffset) if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { return err } } - } if len(res) > 0 { diff --git a/internal/httpclient/client/admin/list_o_auth2_clients_responses.go b/internal/httpclient/client/admin/list_o_auth2_clients_responses.go index 5614a890e21..aaeeb264335 100644 --- a/internal/httpclient/client/admin/list_o_auth2_clients_responses.go +++ b/internal/httpclient/client/admin/list_o_auth2_clients_responses.go @@ -35,9 +35,8 @@ func (o *ListOAuth2ClientsReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -46,7 +45,7 @@ func NewListOAuth2ClientsOK() *ListOAuth2ClientsOK { return &ListOAuth2ClientsOK{} } -/*ListOAuth2ClientsOK handles this case with default header values. +/* ListOAuth2ClientsOK describes a response with status code 200, with default header values. A list of clients. */ @@ -57,7 +56,6 @@ type ListOAuth2ClientsOK struct { func (o *ListOAuth2ClientsOK) Error() string { return fmt.Sprintf("[GET /clients][%d] listOAuth2ClientsOK %+v", 200, o.Payload) } - func (o *ListOAuth2ClientsOK) GetPayload() []*models.OAuth2Client { return o.Payload } @@ -77,7 +75,7 @@ func NewListOAuth2ClientsInternalServerError() *ListOAuth2ClientsInternalServerE return &ListOAuth2ClientsInternalServerError{} } -/*ListOAuth2ClientsInternalServerError handles this case with default header values. +/* ListOAuth2ClientsInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -88,7 +86,6 @@ type ListOAuth2ClientsInternalServerError struct { func (o *ListOAuth2ClientsInternalServerError) Error() string { return fmt.Sprintf("[GET /clients][%d] listOAuth2ClientsInternalServerError %+v", 500, o.Payload) } - func (o *ListOAuth2ClientsInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go b/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go index bca88f73d5f..6788e8f5dab 100644 --- a/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go +++ b/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListSubjectConsentSessionsParams creates a new ListSubjectConsentSessionsParams object -// with the default values initialized. +// NewListSubjectConsentSessionsParams creates a new ListSubjectConsentSessionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewListSubjectConsentSessionsParams() *ListSubjectConsentSessionsParams { - var () return &ListSubjectConsentSessionsParams{ - timeout: cr.DefaultTimeout, } } // NewListSubjectConsentSessionsParamsWithTimeout creates a new ListSubjectConsentSessionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewListSubjectConsentSessionsParamsWithTimeout(timeout time.Duration) *ListSubjectConsentSessionsParams { - var () return &ListSubjectConsentSessionsParams{ - timeout: timeout, } } // NewListSubjectConsentSessionsParamsWithContext creates a new ListSubjectConsentSessionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewListSubjectConsentSessionsParamsWithContext(ctx context.Context) *ListSubjectConsentSessionsParams { - var () return &ListSubjectConsentSessionsParams{ - Context: ctx, } } // NewListSubjectConsentSessionsParamsWithHTTPClient creates a new ListSubjectConsentSessionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewListSubjectConsentSessionsParamsWithHTTPClient(client *http.Client) *ListSubjectConsentSessionsParams { - var () return &ListSubjectConsentSessionsParams{ HTTPClient: client, } } -/*ListSubjectConsentSessionsParams contains all the parameters to send to the API endpoint -for the list subject consent sessions operation typically these are written to a http.Request +/* ListSubjectConsentSessionsParams contains all the parameters to send to the API endpoint + for the list subject consent sessions operation. + + Typically these are written to a http.Request. */ type ListSubjectConsentSessionsParams struct { - /*Subject*/ + // Subject. Subject string timeout time.Duration @@ -68,6 +67,21 @@ type ListSubjectConsentSessionsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the list subject consent sessions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSubjectConsentSessionsParams) WithDefaults() *ListSubjectConsentSessionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list subject consent sessions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListSubjectConsentSessionsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the list subject consent sessions params func (o *ListSubjectConsentSessionsParams) WithTimeout(timeout time.Duration) *ListSubjectConsentSessionsParams { o.SetTimeout(timeout) @@ -124,6 +138,7 @@ func (o *ListSubjectConsentSessionsParams) WriteToRequest(r runtime.ClientReques qrSubject := o.Subject qSubject := qrSubject if qSubject != "" { + if err := r.SetQueryParam("subject", qSubject); err != nil { return err } diff --git a/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go b/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go index 009ebef70a9..4fc96215fce 100644 --- a/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go +++ b/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go @@ -41,9 +41,8 @@ func (o *ListSubjectConsentSessionsReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewListSubjectConsentSessionsOK() *ListSubjectConsentSessionsOK { return &ListSubjectConsentSessionsOK{} } -/*ListSubjectConsentSessionsOK handles this case with default header values. +/* ListSubjectConsentSessionsOK describes a response with status code 200, with default header values. A list of used consent requests. */ @@ -63,7 +62,6 @@ type ListSubjectConsentSessionsOK struct { func (o *ListSubjectConsentSessionsOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/sessions/consent][%d] listSubjectConsentSessionsOK %+v", 200, o.Payload) } - func (o *ListSubjectConsentSessionsOK) GetPayload() []*models.PreviousConsentSession { return o.Payload } @@ -83,7 +81,7 @@ func NewListSubjectConsentSessionsBadRequest() *ListSubjectConsentSessionsBadReq return &ListSubjectConsentSessionsBadRequest{} } -/*ListSubjectConsentSessionsBadRequest handles this case with default header values. +/* ListSubjectConsentSessionsBadRequest describes a response with status code 400, with default header values. jsonError */ @@ -94,7 +92,6 @@ type ListSubjectConsentSessionsBadRequest struct { func (o *ListSubjectConsentSessionsBadRequest) Error() string { return fmt.Sprintf("[GET /oauth2/auth/sessions/consent][%d] listSubjectConsentSessionsBadRequest %+v", 400, o.Payload) } - func (o *ListSubjectConsentSessionsBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -116,7 +113,7 @@ func NewListSubjectConsentSessionsInternalServerError() *ListSubjectConsentSessi return &ListSubjectConsentSessionsInternalServerError{} } -/*ListSubjectConsentSessionsInternalServerError handles this case with default header values. +/* ListSubjectConsentSessionsInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -127,7 +124,6 @@ type ListSubjectConsentSessionsInternalServerError struct { func (o *ListSubjectConsentSessionsInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/sessions/consent][%d] listSubjectConsentSessionsInternalServerError %+v", 500, o.Payload) } - func (o *ListSubjectConsentSessionsInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go b/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go index 1e35ba6e391..bb40dbefc65 100644 --- a/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewPatchOAuth2ClientParams creates a new PatchOAuth2ClientParams object -// with the default values initialized. +// NewPatchOAuth2ClientParams creates a new PatchOAuth2ClientParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPatchOAuth2ClientParams() *PatchOAuth2ClientParams { - var () return &PatchOAuth2ClientParams{ - timeout: cr.DefaultTimeout, } } // NewPatchOAuth2ClientParamsWithTimeout creates a new PatchOAuth2ClientParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPatchOAuth2ClientParamsWithTimeout(timeout time.Duration) *PatchOAuth2ClientParams { - var () return &PatchOAuth2ClientParams{ - timeout: timeout, } } // NewPatchOAuth2ClientParamsWithContext creates a new PatchOAuth2ClientParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPatchOAuth2ClientParamsWithContext(ctx context.Context) *PatchOAuth2ClientParams { - var () return &PatchOAuth2ClientParams{ - Context: ctx, } } // NewPatchOAuth2ClientParamsWithHTTPClient creates a new PatchOAuth2ClientParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPatchOAuth2ClientParamsWithHTTPClient(client *http.Client) *PatchOAuth2ClientParams { - var () return &PatchOAuth2ClientParams{ HTTPClient: client, } } -/*PatchOAuth2ClientParams contains all the parameters to send to the API endpoint -for the patch o auth2 client operation typically these are written to a http.Request +/* PatchOAuth2ClientParams contains all the parameters to send to the API endpoint + for the patch o auth2 client operation. + + Typically these are written to a http.Request. */ type PatchOAuth2ClientParams struct { - /*Body*/ + // Body. Body models.PatchRequest - /*ID*/ + + // ID. ID string timeout time.Duration @@ -72,6 +72,21 @@ type PatchOAuth2ClientParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the patch o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchOAuth2ClientParams) WithDefaults() *PatchOAuth2ClientParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the patch o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchOAuth2ClientParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the patch o auth2 client params func (o *PatchOAuth2ClientParams) WithTimeout(timeout time.Duration) *PatchOAuth2ClientParams { o.SetTimeout(timeout) @@ -134,7 +149,6 @@ func (o *PatchOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg st return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/patch_o_auth2_client_responses.go b/internal/httpclient/client/admin/patch_o_auth2_client_responses.go index fb2f52d8683..9415c04a86c 100644 --- a/internal/httpclient/client/admin/patch_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/patch_o_auth2_client_responses.go @@ -35,9 +35,8 @@ func (o *PatchOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -46,7 +45,7 @@ func NewPatchOAuth2ClientOK() *PatchOAuth2ClientOK { return &PatchOAuth2ClientOK{} } -/*PatchOAuth2ClientOK handles this case with default header values. +/* PatchOAuth2ClientOK describes a response with status code 200, with default header values. oAuth2Client */ @@ -57,7 +56,6 @@ type PatchOAuth2ClientOK struct { func (o *PatchOAuth2ClientOK) Error() string { return fmt.Sprintf("[PATCH /clients/{id}][%d] patchOAuth2ClientOK %+v", 200, o.Payload) } - func (o *PatchOAuth2ClientOK) GetPayload() *models.OAuth2Client { return o.Payload } @@ -79,7 +77,7 @@ func NewPatchOAuth2ClientInternalServerError() *PatchOAuth2ClientInternalServerE return &PatchOAuth2ClientInternalServerError{} } -/*PatchOAuth2ClientInternalServerError handles this case with default header values. +/* PatchOAuth2ClientInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -90,7 +88,6 @@ type PatchOAuth2ClientInternalServerError struct { func (o *PatchOAuth2ClientInternalServerError) Error() string { return fmt.Sprintf("[PATCH /clients/{id}][%d] patchOAuth2ClientInternalServerError %+v", 500, o.Payload) } - func (o *PatchOAuth2ClientInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/reject_consent_request_parameters.go b/internal/httpclient/client/admin/reject_consent_request_parameters.go index eba20d4bd3e..a71725bd0ed 100644 --- a/internal/httpclient/client/admin/reject_consent_request_parameters.go +++ b/internal/httpclient/client/admin/reject_consent_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewRejectConsentRequestParams creates a new RejectConsentRequestParams object -// with the default values initialized. +// NewRejectConsentRequestParams creates a new RejectConsentRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRejectConsentRequestParams() *RejectConsentRequestParams { - var () return &RejectConsentRequestParams{ - timeout: cr.DefaultTimeout, } } // NewRejectConsentRequestParamsWithTimeout creates a new RejectConsentRequestParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRejectConsentRequestParamsWithTimeout(timeout time.Duration) *RejectConsentRequestParams { - var () return &RejectConsentRequestParams{ - timeout: timeout, } } // NewRejectConsentRequestParamsWithContext creates a new RejectConsentRequestParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRejectConsentRequestParamsWithContext(ctx context.Context) *RejectConsentRequestParams { - var () return &RejectConsentRequestParams{ - Context: ctx, } } // NewRejectConsentRequestParamsWithHTTPClient creates a new RejectConsentRequestParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRejectConsentRequestParamsWithHTTPClient(client *http.Client) *RejectConsentRequestParams { - var () return &RejectConsentRequestParams{ HTTPClient: client, } } -/*RejectConsentRequestParams contains all the parameters to send to the API endpoint -for the reject consent request operation typically these are written to a http.Request +/* RejectConsentRequestParams contains all the parameters to send to the API endpoint + for the reject consent request operation. + + Typically these are written to a http.Request. */ type RejectConsentRequestParams struct { - /*Body*/ + // Body. Body *models.RejectRequest - /*ConsentChallenge*/ + + // ConsentChallenge. ConsentChallenge string timeout time.Duration @@ -72,6 +72,21 @@ type RejectConsentRequestParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the reject consent request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RejectConsentRequestParams) WithDefaults() *RejectConsentRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reject consent request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RejectConsentRequestParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the reject consent request params func (o *RejectConsentRequestParams) WithTimeout(timeout time.Duration) *RejectConsentRequestParams { o.SetTimeout(timeout) @@ -134,7 +149,6 @@ func (o *RejectConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -145,6 +159,7 @@ func (o *RejectConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrConsentChallenge := o.ConsentChallenge qConsentChallenge := qrConsentChallenge if qConsentChallenge != "" { + if err := r.SetQueryParam("consent_challenge", qConsentChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/reject_consent_request_responses.go b/internal/httpclient/client/admin/reject_consent_request_responses.go index 9f300b01793..16e00fe420c 100644 --- a/internal/httpclient/client/admin/reject_consent_request_responses.go +++ b/internal/httpclient/client/admin/reject_consent_request_responses.go @@ -41,9 +41,8 @@ func (o *RejectConsentRequestReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewRejectConsentRequestOK() *RejectConsentRequestOK { return &RejectConsentRequestOK{} } -/*RejectConsentRequestOK handles this case with default header values. +/* RejectConsentRequestOK describes a response with status code 200, with default header values. completedRequest */ @@ -63,7 +62,6 @@ type RejectConsentRequestOK struct { func (o *RejectConsentRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/reject][%d] rejectConsentRequestOK %+v", 200, o.Payload) } - func (o *RejectConsentRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -85,7 +83,7 @@ func NewRejectConsentRequestNotFound() *RejectConsentRequestNotFound { return &RejectConsentRequestNotFound{} } -/*RejectConsentRequestNotFound handles this case with default header values. +/* RejectConsentRequestNotFound describes a response with status code 404, with default header values. jsonError */ @@ -96,7 +94,6 @@ type RejectConsentRequestNotFound struct { func (o *RejectConsentRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/reject][%d] rejectConsentRequestNotFound %+v", 404, o.Payload) } - func (o *RejectConsentRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -118,7 +115,7 @@ func NewRejectConsentRequestInternalServerError() *RejectConsentRequestInternalS return &RejectConsentRequestInternalServerError{} } -/*RejectConsentRequestInternalServerError handles this case with default header values. +/* RejectConsentRequestInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -129,7 +126,6 @@ type RejectConsentRequestInternalServerError struct { func (o *RejectConsentRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/reject][%d] rejectConsentRequestInternalServerError %+v", 500, o.Payload) } - func (o *RejectConsentRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/reject_login_request_parameters.go b/internal/httpclient/client/admin/reject_login_request_parameters.go index 03556b805fc..300a4e9b1c3 100644 --- a/internal/httpclient/client/admin/reject_login_request_parameters.go +++ b/internal/httpclient/client/admin/reject_login_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewRejectLoginRequestParams creates a new RejectLoginRequestParams object -// with the default values initialized. +// NewRejectLoginRequestParams creates a new RejectLoginRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRejectLoginRequestParams() *RejectLoginRequestParams { - var () return &RejectLoginRequestParams{ - timeout: cr.DefaultTimeout, } } // NewRejectLoginRequestParamsWithTimeout creates a new RejectLoginRequestParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRejectLoginRequestParamsWithTimeout(timeout time.Duration) *RejectLoginRequestParams { - var () return &RejectLoginRequestParams{ - timeout: timeout, } } // NewRejectLoginRequestParamsWithContext creates a new RejectLoginRequestParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRejectLoginRequestParamsWithContext(ctx context.Context) *RejectLoginRequestParams { - var () return &RejectLoginRequestParams{ - Context: ctx, } } // NewRejectLoginRequestParamsWithHTTPClient creates a new RejectLoginRequestParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRejectLoginRequestParamsWithHTTPClient(client *http.Client) *RejectLoginRequestParams { - var () return &RejectLoginRequestParams{ HTTPClient: client, } } -/*RejectLoginRequestParams contains all the parameters to send to the API endpoint -for the reject login request operation typically these are written to a http.Request +/* RejectLoginRequestParams contains all the parameters to send to the API endpoint + for the reject login request operation. + + Typically these are written to a http.Request. */ type RejectLoginRequestParams struct { - /*Body*/ + // Body. Body *models.RejectRequest - /*LoginChallenge*/ + + // LoginChallenge. LoginChallenge string timeout time.Duration @@ -72,6 +72,21 @@ type RejectLoginRequestParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the reject login request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RejectLoginRequestParams) WithDefaults() *RejectLoginRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reject login request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RejectLoginRequestParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the reject login request params func (o *RejectLoginRequestParams) WithTimeout(timeout time.Duration) *RejectLoginRequestParams { o.SetTimeout(timeout) @@ -134,7 +149,6 @@ func (o *RejectLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -145,6 +159,7 @@ func (o *RejectLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s qrLoginChallenge := o.LoginChallenge qLoginChallenge := qrLoginChallenge if qLoginChallenge != "" { + if err := r.SetQueryParam("login_challenge", qLoginChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/reject_login_request_responses.go b/internal/httpclient/client/admin/reject_login_request_responses.go index edc2b3e66ad..aa45932f0c7 100644 --- a/internal/httpclient/client/admin/reject_login_request_responses.go +++ b/internal/httpclient/client/admin/reject_login_request_responses.go @@ -53,9 +53,8 @@ func (o *RejectLoginRequestReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -64,7 +63,7 @@ func NewRejectLoginRequestOK() *RejectLoginRequestOK { return &RejectLoginRequestOK{} } -/*RejectLoginRequestOK handles this case with default header values. +/* RejectLoginRequestOK describes a response with status code 200, with default header values. completedRequest */ @@ -75,7 +74,6 @@ type RejectLoginRequestOK struct { func (o *RejectLoginRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestOK %+v", 200, o.Payload) } - func (o *RejectLoginRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -97,7 +95,7 @@ func NewRejectLoginRequestBadRequest() *RejectLoginRequestBadRequest { return &RejectLoginRequestBadRequest{} } -/*RejectLoginRequestBadRequest handles this case with default header values. +/* RejectLoginRequestBadRequest describes a response with status code 400, with default header values. jsonError */ @@ -108,7 +106,6 @@ type RejectLoginRequestBadRequest struct { func (o *RejectLoginRequestBadRequest) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestBadRequest %+v", 400, o.Payload) } - func (o *RejectLoginRequestBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -130,7 +127,7 @@ func NewRejectLoginRequestUnauthorized() *RejectLoginRequestUnauthorized { return &RejectLoginRequestUnauthorized{} } -/*RejectLoginRequestUnauthorized handles this case with default header values. +/* RejectLoginRequestUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -141,7 +138,6 @@ type RejectLoginRequestUnauthorized struct { func (o *RejectLoginRequestUnauthorized) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestUnauthorized %+v", 401, o.Payload) } - func (o *RejectLoginRequestUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -163,7 +159,7 @@ func NewRejectLoginRequestNotFound() *RejectLoginRequestNotFound { return &RejectLoginRequestNotFound{} } -/*RejectLoginRequestNotFound handles this case with default header values. +/* RejectLoginRequestNotFound describes a response with status code 404, with default header values. jsonError */ @@ -174,7 +170,6 @@ type RejectLoginRequestNotFound struct { func (o *RejectLoginRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestNotFound %+v", 404, o.Payload) } - func (o *RejectLoginRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -196,7 +191,7 @@ func NewRejectLoginRequestInternalServerError() *RejectLoginRequestInternalServe return &RejectLoginRequestInternalServerError{} } -/*RejectLoginRequestInternalServerError handles this case with default header values. +/* RejectLoginRequestInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -207,7 +202,6 @@ type RejectLoginRequestInternalServerError struct { func (o *RejectLoginRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestInternalServerError %+v", 500, o.Payload) } - func (o *RejectLoginRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/reject_logout_request_parameters.go b/internal/httpclient/client/admin/reject_logout_request_parameters.go index be87d346429..f39e96898b2 100644 --- a/internal/httpclient/client/admin/reject_logout_request_parameters.go +++ b/internal/httpclient/client/admin/reject_logout_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewRejectLogoutRequestParams creates a new RejectLogoutRequestParams object -// with the default values initialized. +// NewRejectLogoutRequestParams creates a new RejectLogoutRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRejectLogoutRequestParams() *RejectLogoutRequestParams { - var () return &RejectLogoutRequestParams{ - timeout: cr.DefaultTimeout, } } // NewRejectLogoutRequestParamsWithTimeout creates a new RejectLogoutRequestParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRejectLogoutRequestParamsWithTimeout(timeout time.Duration) *RejectLogoutRequestParams { - var () return &RejectLogoutRequestParams{ - timeout: timeout, } } // NewRejectLogoutRequestParamsWithContext creates a new RejectLogoutRequestParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRejectLogoutRequestParamsWithContext(ctx context.Context) *RejectLogoutRequestParams { - var () return &RejectLogoutRequestParams{ - Context: ctx, } } // NewRejectLogoutRequestParamsWithHTTPClient creates a new RejectLogoutRequestParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRejectLogoutRequestParamsWithHTTPClient(client *http.Client) *RejectLogoutRequestParams { - var () return &RejectLogoutRequestParams{ HTTPClient: client, } } -/*RejectLogoutRequestParams contains all the parameters to send to the API endpoint -for the reject logout request operation typically these are written to a http.Request +/* RejectLogoutRequestParams contains all the parameters to send to the API endpoint + for the reject logout request operation. + + Typically these are written to a http.Request. */ type RejectLogoutRequestParams struct { - /*Body*/ + // Body. Body *models.RejectRequest - /*LogoutChallenge*/ + + // LogoutChallenge. LogoutChallenge string timeout time.Duration @@ -72,6 +72,21 @@ type RejectLogoutRequestParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the reject logout request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RejectLogoutRequestParams) WithDefaults() *RejectLogoutRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the reject logout request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RejectLogoutRequestParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the reject logout request params func (o *RejectLogoutRequestParams) WithTimeout(timeout time.Duration) *RejectLogoutRequestParams { o.SetTimeout(timeout) @@ -134,7 +149,6 @@ func (o *RejectLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -145,6 +159,7 @@ func (o *RejectLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrLogoutChallenge := o.LogoutChallenge qLogoutChallenge := qrLogoutChallenge if qLogoutChallenge != "" { + if err := r.SetQueryParam("logout_challenge", qLogoutChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/reject_logout_request_responses.go b/internal/httpclient/client/admin/reject_logout_request_responses.go index 30181ba0928..0ebd365c5a6 100644 --- a/internal/httpclient/client/admin/reject_logout_request_responses.go +++ b/internal/httpclient/client/admin/reject_logout_request_responses.go @@ -41,9 +41,8 @@ func (o *RejectLogoutRequestReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,9 +51,9 @@ func NewRejectLogoutRequestNoContent() *RejectLogoutRequestNoContent { return &RejectLogoutRequestNoContent{} } -/*RejectLogoutRequestNoContent handles this case with default header values. +/* RejectLogoutRequestNoContent describes a response with status code 204, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RejectLogoutRequestNoContent struct { @@ -74,7 +73,7 @@ func NewRejectLogoutRequestNotFound() *RejectLogoutRequestNotFound { return &RejectLogoutRequestNotFound{} } -/*RejectLogoutRequestNotFound handles this case with default header values. +/* RejectLogoutRequestNotFound describes a response with status code 404, with default header values. jsonError */ @@ -85,7 +84,6 @@ type RejectLogoutRequestNotFound struct { func (o *RejectLogoutRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/reject][%d] rejectLogoutRequestNotFound %+v", 404, o.Payload) } - func (o *RejectLogoutRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -107,7 +105,7 @@ func NewRejectLogoutRequestInternalServerError() *RejectLogoutRequestInternalSer return &RejectLogoutRequestInternalServerError{} } -/*RejectLogoutRequestInternalServerError handles this case with default header values. +/* RejectLogoutRequestInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -118,7 +116,6 @@ type RejectLogoutRequestInternalServerError struct { func (o *RejectLogoutRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/reject][%d] rejectLogoutRequestInternalServerError %+v", 500, o.Payload) } - func (o *RejectLogoutRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/revoke_authentication_session_parameters.go b/internal/httpclient/client/admin/revoke_authentication_session_parameters.go index dab7c8b54dd..780e8fd0266 100644 --- a/internal/httpclient/client/admin/revoke_authentication_session_parameters.go +++ b/internal/httpclient/client/admin/revoke_authentication_session_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRevokeAuthenticationSessionParams creates a new RevokeAuthenticationSessionParams object -// with the default values initialized. +// NewRevokeAuthenticationSessionParams creates a new RevokeAuthenticationSessionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRevokeAuthenticationSessionParams() *RevokeAuthenticationSessionParams { - var () return &RevokeAuthenticationSessionParams{ - timeout: cr.DefaultTimeout, } } // NewRevokeAuthenticationSessionParamsWithTimeout creates a new RevokeAuthenticationSessionParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRevokeAuthenticationSessionParamsWithTimeout(timeout time.Duration) *RevokeAuthenticationSessionParams { - var () return &RevokeAuthenticationSessionParams{ - timeout: timeout, } } // NewRevokeAuthenticationSessionParamsWithContext creates a new RevokeAuthenticationSessionParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRevokeAuthenticationSessionParamsWithContext(ctx context.Context) *RevokeAuthenticationSessionParams { - var () return &RevokeAuthenticationSessionParams{ - Context: ctx, } } // NewRevokeAuthenticationSessionParamsWithHTTPClient creates a new RevokeAuthenticationSessionParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRevokeAuthenticationSessionParamsWithHTTPClient(client *http.Client) *RevokeAuthenticationSessionParams { - var () return &RevokeAuthenticationSessionParams{ HTTPClient: client, } } -/*RevokeAuthenticationSessionParams contains all the parameters to send to the API endpoint -for the revoke authentication session operation typically these are written to a http.Request +/* RevokeAuthenticationSessionParams contains all the parameters to send to the API endpoint + for the revoke authentication session operation. + + Typically these are written to a http.Request. */ type RevokeAuthenticationSessionParams struct { - /*Subject*/ + // Subject. Subject string timeout time.Duration @@ -68,6 +67,21 @@ type RevokeAuthenticationSessionParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the revoke authentication session params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeAuthenticationSessionParams) WithDefaults() *RevokeAuthenticationSessionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the revoke authentication session params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeAuthenticationSessionParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the revoke authentication session params func (o *RevokeAuthenticationSessionParams) WithTimeout(timeout time.Duration) *RevokeAuthenticationSessionParams { o.SetTimeout(timeout) @@ -124,6 +138,7 @@ func (o *RevokeAuthenticationSessionParams) WriteToRequest(r runtime.ClientReque qrSubject := o.Subject qSubject := qrSubject if qSubject != "" { + if err := r.SetQueryParam("subject", qSubject); err != nil { return err } diff --git a/internal/httpclient/client/admin/revoke_authentication_session_responses.go b/internal/httpclient/client/admin/revoke_authentication_session_responses.go index bd18b558cd4..ae2ae24e964 100644 --- a/internal/httpclient/client/admin/revoke_authentication_session_responses.go +++ b/internal/httpclient/client/admin/revoke_authentication_session_responses.go @@ -41,9 +41,8 @@ func (o *RevokeAuthenticationSessionReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,9 +51,9 @@ func NewRevokeAuthenticationSessionNoContent() *RevokeAuthenticationSessionNoCon return &RevokeAuthenticationSessionNoContent{} } -/*RevokeAuthenticationSessionNoContent handles this case with default header values. +/* RevokeAuthenticationSessionNoContent describes a response with status code 204, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RevokeAuthenticationSessionNoContent struct { @@ -74,7 +73,7 @@ func NewRevokeAuthenticationSessionBadRequest() *RevokeAuthenticationSessionBadR return &RevokeAuthenticationSessionBadRequest{} } -/*RevokeAuthenticationSessionBadRequest handles this case with default header values. +/* RevokeAuthenticationSessionBadRequest describes a response with status code 400, with default header values. jsonError */ @@ -85,7 +84,6 @@ type RevokeAuthenticationSessionBadRequest struct { func (o *RevokeAuthenticationSessionBadRequest) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/login][%d] revokeAuthenticationSessionBadRequest %+v", 400, o.Payload) } - func (o *RevokeAuthenticationSessionBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -107,7 +105,7 @@ func NewRevokeAuthenticationSessionInternalServerError() *RevokeAuthenticationSe return &RevokeAuthenticationSessionInternalServerError{} } -/*RevokeAuthenticationSessionInternalServerError handles this case with default header values. +/* RevokeAuthenticationSessionInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -118,7 +116,6 @@ type RevokeAuthenticationSessionInternalServerError struct { func (o *RevokeAuthenticationSessionInternalServerError) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/login][%d] revokeAuthenticationSessionInternalServerError %+v", 500, o.Payload) } - func (o *RevokeAuthenticationSessionInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go b/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go index 6dadc668afd..357224b576f 100644 --- a/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go +++ b/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go @@ -17,63 +17,64 @@ import ( "github.com/go-openapi/swag" ) -// NewRevokeConsentSessionsParams creates a new RevokeConsentSessionsParams object -// with the default values initialized. +// NewRevokeConsentSessionsParams creates a new RevokeConsentSessionsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRevokeConsentSessionsParams() *RevokeConsentSessionsParams { - var () return &RevokeConsentSessionsParams{ - timeout: cr.DefaultTimeout, } } // NewRevokeConsentSessionsParamsWithTimeout creates a new RevokeConsentSessionsParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRevokeConsentSessionsParamsWithTimeout(timeout time.Duration) *RevokeConsentSessionsParams { - var () return &RevokeConsentSessionsParams{ - timeout: timeout, } } // NewRevokeConsentSessionsParamsWithContext creates a new RevokeConsentSessionsParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRevokeConsentSessionsParamsWithContext(ctx context.Context) *RevokeConsentSessionsParams { - var () return &RevokeConsentSessionsParams{ - Context: ctx, } } // NewRevokeConsentSessionsParamsWithHTTPClient creates a new RevokeConsentSessionsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRevokeConsentSessionsParamsWithHTTPClient(client *http.Client) *RevokeConsentSessionsParams { - var () return &RevokeConsentSessionsParams{ HTTPClient: client, } } -/*RevokeConsentSessionsParams contains all the parameters to send to the API endpoint -for the revoke consent sessions operation typically these are written to a http.Request +/* RevokeConsentSessionsParams contains all the parameters to send to the API endpoint + for the revoke consent sessions operation. + + Typically these are written to a http.Request. */ type RevokeConsentSessionsParams struct { - /*All - If set to `?all=true`, deletes all consent sessions by the Subject that have been granted. + /* All. + If set to `?all=true`, deletes all consent sessions by the Subject that have been granted. */ All *bool - /*Client - If set, deletes only those consent sessions by the Subject that have been granted to the specified OAuth 2.0 Client ID + /* Client. + + If set, deletes only those consent sessions by the Subject that have been granted to the specified OAuth 2.0 Client ID */ Client *string - /*Subject - The subject (Subject) who's consent sessions should be deleted. + /* Subject. + + The subject (Subject) who's consent sessions should be deleted. */ Subject string @@ -82,6 +83,21 @@ type RevokeConsentSessionsParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the revoke consent sessions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeConsentSessionsParams) WithDefaults() *RevokeConsentSessionsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the revoke consent sessions params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeConsentSessionsParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the revoke consent sessions params func (o *RevokeConsentSessionsParams) WithTimeout(timeout time.Duration) *RevokeConsentSessionsParams { o.SetTimeout(timeout) @@ -160,38 +176,41 @@ func (o *RevokeConsentSessionsParams) WriteToRequest(r runtime.ClientRequest, re // query param all var qrAll bool + if o.All != nil { qrAll = *o.All } qAll := swag.FormatBool(qrAll) if qAll != "" { + if err := r.SetQueryParam("all", qAll); err != nil { return err } } - } if o.Client != nil { // query param client var qrClient string + if o.Client != nil { qrClient = *o.Client } qClient := qrClient if qClient != "" { + if err := r.SetQueryParam("client", qClient); err != nil { return err } } - } // query param subject qrSubject := o.Subject qSubject := qrSubject if qSubject != "" { + if err := r.SetQueryParam("subject", qSubject); err != nil { return err } diff --git a/internal/httpclient/client/admin/revoke_consent_sessions_responses.go b/internal/httpclient/client/admin/revoke_consent_sessions_responses.go index fdff5894287..168fe30d353 100644 --- a/internal/httpclient/client/admin/revoke_consent_sessions_responses.go +++ b/internal/httpclient/client/admin/revoke_consent_sessions_responses.go @@ -41,9 +41,8 @@ func (o *RevokeConsentSessionsReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,9 +51,9 @@ func NewRevokeConsentSessionsNoContent() *RevokeConsentSessionsNoContent { return &RevokeConsentSessionsNoContent{} } -/*RevokeConsentSessionsNoContent handles this case with default header values. +/* RevokeConsentSessionsNoContent describes a response with status code 204, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RevokeConsentSessionsNoContent struct { @@ -74,7 +73,7 @@ func NewRevokeConsentSessionsBadRequest() *RevokeConsentSessionsBadRequest { return &RevokeConsentSessionsBadRequest{} } -/*RevokeConsentSessionsBadRequest handles this case with default header values. +/* RevokeConsentSessionsBadRequest describes a response with status code 400, with default header values. jsonError */ @@ -85,7 +84,6 @@ type RevokeConsentSessionsBadRequest struct { func (o *RevokeConsentSessionsBadRequest) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/consent][%d] revokeConsentSessionsBadRequest %+v", 400, o.Payload) } - func (o *RevokeConsentSessionsBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -107,7 +105,7 @@ func NewRevokeConsentSessionsInternalServerError() *RevokeConsentSessionsInterna return &RevokeConsentSessionsInternalServerError{} } -/*RevokeConsentSessionsInternalServerError handles this case with default header values. +/* RevokeConsentSessionsInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -118,7 +116,6 @@ type RevokeConsentSessionsInternalServerError struct { func (o *RevokeConsentSessionsInternalServerError) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/consent][%d] revokeConsentSessionsInternalServerError %+v", 500, o.Payload) } - func (o *RevokeConsentSessionsInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/update_json_web_key_parameters.go b/internal/httpclient/client/admin/update_json_web_key_parameters.go index 23d00be45c1..1d58a24513f 100644 --- a/internal/httpclient/client/admin/update_json_web_key_parameters.go +++ b/internal/httpclient/client/admin/update_json_web_key_parameters.go @@ -18,60 +18,61 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewUpdateJSONWebKeyParams creates a new UpdateJSONWebKeyParams object -// with the default values initialized. +// NewUpdateJSONWebKeyParams creates a new UpdateJSONWebKeyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateJSONWebKeyParams() *UpdateJSONWebKeyParams { - var () return &UpdateJSONWebKeyParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateJSONWebKeyParamsWithTimeout creates a new UpdateJSONWebKeyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateJSONWebKeyParamsWithTimeout(timeout time.Duration) *UpdateJSONWebKeyParams { - var () return &UpdateJSONWebKeyParams{ - timeout: timeout, } } // NewUpdateJSONWebKeyParamsWithContext creates a new UpdateJSONWebKeyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateJSONWebKeyParamsWithContext(ctx context.Context) *UpdateJSONWebKeyParams { - var () return &UpdateJSONWebKeyParams{ - Context: ctx, } } // NewUpdateJSONWebKeyParamsWithHTTPClient creates a new UpdateJSONWebKeyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateJSONWebKeyParamsWithHTTPClient(client *http.Client) *UpdateJSONWebKeyParams { - var () return &UpdateJSONWebKeyParams{ HTTPClient: client, } } -/*UpdateJSONWebKeyParams contains all the parameters to send to the API endpoint -for the update Json web key operation typically these are written to a http.Request +/* UpdateJSONWebKeyParams contains all the parameters to send to the API endpoint + for the update Json web key operation. + + Typically these are written to a http.Request. */ type UpdateJSONWebKeyParams struct { - /*Body*/ + // Body. Body *models.JSONWebKey - /*Kid - The kid of the desired key + /* Kid. + + The kid of the desired key */ Kid string - /*Set - The set + /* Set. + + The set */ Set string @@ -80,6 +81,21 @@ type UpdateJSONWebKeyParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update Json web key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateJSONWebKeyParams) WithDefaults() *UpdateJSONWebKeyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update Json web key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateJSONWebKeyParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update Json web key params func (o *UpdateJSONWebKeyParams) WithTimeout(timeout time.Duration) *UpdateJSONWebKeyParams { o.SetTimeout(timeout) @@ -153,7 +169,6 @@ func (o *UpdateJSONWebKeyParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/update_json_web_key_responses.go b/internal/httpclient/client/admin/update_json_web_key_responses.go index fe134e053e6..59ef84d5d52 100644 --- a/internal/httpclient/client/admin/update_json_web_key_responses.go +++ b/internal/httpclient/client/admin/update_json_web_key_responses.go @@ -47,9 +47,8 @@ func (o *UpdateJSONWebKeyReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -58,7 +57,7 @@ func NewUpdateJSONWebKeyOK() *UpdateJSONWebKeyOK { return &UpdateJSONWebKeyOK{} } -/*UpdateJSONWebKeyOK handles this case with default header values. +/* UpdateJSONWebKeyOK describes a response with status code 200, with default header values. JSONWebKey */ @@ -69,7 +68,6 @@ type UpdateJSONWebKeyOK struct { func (o *UpdateJSONWebKeyOK) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyOK %+v", 200, o.Payload) } - func (o *UpdateJSONWebKeyOK) GetPayload() *models.JSONWebKey { return o.Payload } @@ -91,7 +89,7 @@ func NewUpdateJSONWebKeyUnauthorized() *UpdateJSONWebKeyUnauthorized { return &UpdateJSONWebKeyUnauthorized{} } -/*UpdateJSONWebKeyUnauthorized handles this case with default header values. +/* UpdateJSONWebKeyUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -102,7 +100,6 @@ type UpdateJSONWebKeyUnauthorized struct { func (o *UpdateJSONWebKeyUnauthorized) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyUnauthorized %+v", 401, o.Payload) } - func (o *UpdateJSONWebKeyUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -124,7 +121,7 @@ func NewUpdateJSONWebKeyForbidden() *UpdateJSONWebKeyForbidden { return &UpdateJSONWebKeyForbidden{} } -/*UpdateJSONWebKeyForbidden handles this case with default header values. +/* UpdateJSONWebKeyForbidden describes a response with status code 403, with default header values. jsonError */ @@ -135,7 +132,6 @@ type UpdateJSONWebKeyForbidden struct { func (o *UpdateJSONWebKeyForbidden) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyForbidden %+v", 403, o.Payload) } - func (o *UpdateJSONWebKeyForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -157,7 +153,7 @@ func NewUpdateJSONWebKeyInternalServerError() *UpdateJSONWebKeyInternalServerErr return &UpdateJSONWebKeyInternalServerError{} } -/*UpdateJSONWebKeyInternalServerError handles this case with default header values. +/* UpdateJSONWebKeyInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -168,7 +164,6 @@ type UpdateJSONWebKeyInternalServerError struct { func (o *UpdateJSONWebKeyInternalServerError) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyInternalServerError %+v", 500, o.Payload) } - func (o *UpdateJSONWebKeyInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/update_json_web_key_set_parameters.go b/internal/httpclient/client/admin/update_json_web_key_set_parameters.go index 5d5de04e2f1..20cc85a3770 100644 --- a/internal/httpclient/client/admin/update_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/update_json_web_key_set_parameters.go @@ -18,55 +18,55 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewUpdateJSONWebKeySetParams creates a new UpdateJSONWebKeySetParams object -// with the default values initialized. +// NewUpdateJSONWebKeySetParams creates a new UpdateJSONWebKeySetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateJSONWebKeySetParams() *UpdateJSONWebKeySetParams { - var () return &UpdateJSONWebKeySetParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateJSONWebKeySetParamsWithTimeout creates a new UpdateJSONWebKeySetParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateJSONWebKeySetParamsWithTimeout(timeout time.Duration) *UpdateJSONWebKeySetParams { - var () return &UpdateJSONWebKeySetParams{ - timeout: timeout, } } // NewUpdateJSONWebKeySetParamsWithContext creates a new UpdateJSONWebKeySetParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateJSONWebKeySetParamsWithContext(ctx context.Context) *UpdateJSONWebKeySetParams { - var () return &UpdateJSONWebKeySetParams{ - Context: ctx, } } // NewUpdateJSONWebKeySetParamsWithHTTPClient creates a new UpdateJSONWebKeySetParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateJSONWebKeySetParamsWithHTTPClient(client *http.Client) *UpdateJSONWebKeySetParams { - var () return &UpdateJSONWebKeySetParams{ HTTPClient: client, } } -/*UpdateJSONWebKeySetParams contains all the parameters to send to the API endpoint -for the update Json web key set operation typically these are written to a http.Request +/* UpdateJSONWebKeySetParams contains all the parameters to send to the API endpoint + for the update Json web key set operation. + + Typically these are written to a http.Request. */ type UpdateJSONWebKeySetParams struct { - /*Body*/ + // Body. Body *models.JSONWebKeySet - /*Set - The set + /* Set. + + The set */ Set string @@ -75,6 +75,21 @@ type UpdateJSONWebKeySetParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update Json web key set params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateJSONWebKeySetParams) WithDefaults() *UpdateJSONWebKeySetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update Json web key set params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateJSONWebKeySetParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update Json web key set params func (o *UpdateJSONWebKeySetParams) WithTimeout(timeout time.Duration) *UpdateJSONWebKeySetParams { o.SetTimeout(timeout) @@ -137,7 +152,6 @@ func (o *UpdateJSONWebKeySetParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/update_json_web_key_set_responses.go b/internal/httpclient/client/admin/update_json_web_key_set_responses.go index b48ffb1fc13..fbc2a60031e 100644 --- a/internal/httpclient/client/admin/update_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/update_json_web_key_set_responses.go @@ -47,9 +47,8 @@ func (o *UpdateJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -58,7 +57,7 @@ func NewUpdateJSONWebKeySetOK() *UpdateJSONWebKeySetOK { return &UpdateJSONWebKeySetOK{} } -/*UpdateJSONWebKeySetOK handles this case with default header values. +/* UpdateJSONWebKeySetOK describes a response with status code 200, with default header values. JSONWebKeySet */ @@ -69,7 +68,6 @@ type UpdateJSONWebKeySetOK struct { func (o *UpdateJSONWebKeySetOK) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetOK %+v", 200, o.Payload) } - func (o *UpdateJSONWebKeySetOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -91,7 +89,7 @@ func NewUpdateJSONWebKeySetUnauthorized() *UpdateJSONWebKeySetUnauthorized { return &UpdateJSONWebKeySetUnauthorized{} } -/*UpdateJSONWebKeySetUnauthorized handles this case with default header values. +/* UpdateJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -102,7 +100,6 @@ type UpdateJSONWebKeySetUnauthorized struct { func (o *UpdateJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetUnauthorized %+v", 401, o.Payload) } - func (o *UpdateJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -124,7 +121,7 @@ func NewUpdateJSONWebKeySetForbidden() *UpdateJSONWebKeySetForbidden { return &UpdateJSONWebKeySetForbidden{} } -/*UpdateJSONWebKeySetForbidden handles this case with default header values. +/* UpdateJSONWebKeySetForbidden describes a response with status code 403, with default header values. jsonError */ @@ -135,7 +132,6 @@ type UpdateJSONWebKeySetForbidden struct { func (o *UpdateJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetForbidden %+v", 403, o.Payload) } - func (o *UpdateJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -157,7 +153,7 @@ func NewUpdateJSONWebKeySetInternalServerError() *UpdateJSONWebKeySetInternalSer return &UpdateJSONWebKeySetInternalServerError{} } -/*UpdateJSONWebKeySetInternalServerError handles this case with default header values. +/* UpdateJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -168,7 +164,6 @@ type UpdateJSONWebKeySetInternalServerError struct { func (o *UpdateJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetInternalServerError %+v", 500, o.Payload) } - func (o *UpdateJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/update_o_auth2_client_parameters.go b/internal/httpclient/client/admin/update_o_auth2_client_parameters.go index 85400c84f9f..d767532c9a0 100644 --- a/internal/httpclient/client/admin/update_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/update_o_auth2_client_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewUpdateOAuth2ClientParams creates a new UpdateOAuth2ClientParams object -// with the default values initialized. +// NewUpdateOAuth2ClientParams creates a new UpdateOAuth2ClientParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUpdateOAuth2ClientParams() *UpdateOAuth2ClientParams { - var () return &UpdateOAuth2ClientParams{ - timeout: cr.DefaultTimeout, } } // NewUpdateOAuth2ClientParamsWithTimeout creates a new UpdateOAuth2ClientParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUpdateOAuth2ClientParamsWithTimeout(timeout time.Duration) *UpdateOAuth2ClientParams { - var () return &UpdateOAuth2ClientParams{ - timeout: timeout, } } // NewUpdateOAuth2ClientParamsWithContext creates a new UpdateOAuth2ClientParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUpdateOAuth2ClientParamsWithContext(ctx context.Context) *UpdateOAuth2ClientParams { - var () return &UpdateOAuth2ClientParams{ - Context: ctx, } } // NewUpdateOAuth2ClientParamsWithHTTPClient creates a new UpdateOAuth2ClientParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUpdateOAuth2ClientParamsWithHTTPClient(client *http.Client) *UpdateOAuth2ClientParams { - var () return &UpdateOAuth2ClientParams{ HTTPClient: client, } } -/*UpdateOAuth2ClientParams contains all the parameters to send to the API endpoint -for the update o auth2 client operation typically these are written to a http.Request +/* UpdateOAuth2ClientParams contains all the parameters to send to the API endpoint + for the update o auth2 client operation. + + Typically these are written to a http.Request. */ type UpdateOAuth2ClientParams struct { - /*Body*/ + // Body. Body *models.OAuth2Client - /*ID*/ + + // ID. ID string timeout time.Duration @@ -72,6 +72,21 @@ type UpdateOAuth2ClientParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the update o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateOAuth2ClientParams) WithDefaults() *UpdateOAuth2ClientParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update o auth2 client params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateOAuth2ClientParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the update o auth2 client params func (o *UpdateOAuth2ClientParams) WithTimeout(timeout time.Duration) *UpdateOAuth2ClientParams { o.SetTimeout(timeout) @@ -134,7 +149,6 @@ func (o *UpdateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/update_o_auth2_client_responses.go b/internal/httpclient/client/admin/update_o_auth2_client_responses.go index 150c68fe1d8..ce776c59ef3 100644 --- a/internal/httpclient/client/admin/update_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/update_o_auth2_client_responses.go @@ -35,9 +35,8 @@ func (o *UpdateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -46,7 +45,7 @@ func NewUpdateOAuth2ClientOK() *UpdateOAuth2ClientOK { return &UpdateOAuth2ClientOK{} } -/*UpdateOAuth2ClientOK handles this case with default header values. +/* UpdateOAuth2ClientOK describes a response with status code 200, with default header values. oAuth2Client */ @@ -57,7 +56,6 @@ type UpdateOAuth2ClientOK struct { func (o *UpdateOAuth2ClientOK) Error() string { return fmt.Sprintf("[PUT /clients/{id}][%d] updateOAuth2ClientOK %+v", 200, o.Payload) } - func (o *UpdateOAuth2ClientOK) GetPayload() *models.OAuth2Client { return o.Payload } @@ -79,7 +77,7 @@ func NewUpdateOAuth2ClientInternalServerError() *UpdateOAuth2ClientInternalServe return &UpdateOAuth2ClientInternalServerError{} } -/*UpdateOAuth2ClientInternalServerError handles this case with default header values. +/* UpdateOAuth2ClientInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -90,7 +88,6 @@ type UpdateOAuth2ClientInternalServerError struct { func (o *UpdateOAuth2ClientInternalServerError) Error() string { return fmt.Sprintf("[PUT /clients/{id}][%d] updateOAuth2ClientInternalServerError %+v", 500, o.Payload) } - func (o *UpdateOAuth2ClientInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/metadata/metadata_client.go b/internal/httpclient/client/metadata/metadata_client.go index 73bf982a7e6..669fe3539b1 100644 --- a/internal/httpclient/client/metadata/metadata_client.go +++ b/internal/httpclient/client/metadata/metadata_client.go @@ -25,9 +25,12 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - Prometheus(params *PrometheusParams) (*PrometheusOK, error) + Prometheus(params *PrometheusParams, opts ...ClientOption) (*PrometheusOK, error) SetTransport(transport runtime.ClientTransport) } @@ -42,13 +45,12 @@ prometheus.io/port: "4434" prometheus.io/path: "/metrics/prometheus" ``` */ -func (a *Client) Prometheus(params *PrometheusParams) (*PrometheusOK, error) { +func (a *Client) Prometheus(params *PrometheusParams, opts ...ClientOption) (*PrometheusOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPrometheusParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "prometheus", Method: "GET", PathPattern: "/metrics/prometheus", @@ -59,7 +61,12 @@ func (a *Client) Prometheus(params *PrometheusParams) (*PrometheusOK, error) { Reader: &PrometheusReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/internal/httpclient/client/metadata/prometheus_parameters.go b/internal/httpclient/client/metadata/prometheus_parameters.go index 06b59ae0691..b98a921ea85 100644 --- a/internal/httpclient/client/metadata/prometheus_parameters.go +++ b/internal/httpclient/client/metadata/prometheus_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewPrometheusParams creates a new PrometheusParams object -// with the default values initialized. +// NewPrometheusParams creates a new PrometheusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewPrometheusParams() *PrometheusParams { - return &PrometheusParams{ - timeout: cr.DefaultTimeout, } } // NewPrometheusParamsWithTimeout creates a new PrometheusParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewPrometheusParamsWithTimeout(timeout time.Duration) *PrometheusParams { - return &PrometheusParams{ - timeout: timeout, } } // NewPrometheusParamsWithContext creates a new PrometheusParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewPrometheusParamsWithContext(ctx context.Context) *PrometheusParams { - return &PrometheusParams{ - Context: ctx, } } // NewPrometheusParamsWithHTTPClient creates a new PrometheusParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewPrometheusParamsWithHTTPClient(client *http.Client) *PrometheusParams { - return &PrometheusParams{ HTTPClient: client, } } -/*PrometheusParams contains all the parameters to send to the API endpoint -for the prometheus operation typically these are written to a http.Request +/* PrometheusParams contains all the parameters to send to the API endpoint + for the prometheus operation. + + Typically these are written to a http.Request. */ type PrometheusParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type PrometheusParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the prometheus params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PrometheusParams) WithDefaults() *PrometheusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the prometheus params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PrometheusParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the prometheus params func (o *PrometheusParams) WithTimeout(timeout time.Duration) *PrometheusParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/metadata/prometheus_responses.go b/internal/httpclient/client/metadata/prometheus_responses.go index 8a4835a2d1f..91a18f4a176 100644 --- a/internal/httpclient/client/metadata/prometheus_responses.go +++ b/internal/httpclient/client/metadata/prometheus_responses.go @@ -26,9 +26,8 @@ func (o *PrometheusReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return result, nil - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -37,9 +36,9 @@ func NewPrometheusOK() *PrometheusOK { return &PrometheusOK{} } -/*PrometheusOK handles this case with default header values. +/* PrometheusOK describes a response with status code 200, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type PrometheusOK struct { diff --git a/internal/httpclient/client/public/disconnect_user_parameters.go b/internal/httpclient/client/public/disconnect_user_parameters.go index e87c91fff85..e0c9b3938d5 100644 --- a/internal/httpclient/client/public/disconnect_user_parameters.go +++ b/internal/httpclient/client/public/disconnect_user_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDisconnectUserParams creates a new DisconnectUserParams object -// with the default values initialized. +// NewDisconnectUserParams creates a new DisconnectUserParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDisconnectUserParams() *DisconnectUserParams { - return &DisconnectUserParams{ - timeout: cr.DefaultTimeout, } } // NewDisconnectUserParamsWithTimeout creates a new DisconnectUserParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDisconnectUserParamsWithTimeout(timeout time.Duration) *DisconnectUserParams { - return &DisconnectUserParams{ - timeout: timeout, } } // NewDisconnectUserParamsWithContext creates a new DisconnectUserParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDisconnectUserParamsWithContext(ctx context.Context) *DisconnectUserParams { - return &DisconnectUserParams{ - Context: ctx, } } // NewDisconnectUserParamsWithHTTPClient creates a new DisconnectUserParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDisconnectUserParamsWithHTTPClient(client *http.Client) *DisconnectUserParams { - return &DisconnectUserParams{ HTTPClient: client, } } -/*DisconnectUserParams contains all the parameters to send to the API endpoint -for the disconnect user operation typically these are written to a http.Request +/* DisconnectUserParams contains all the parameters to send to the API endpoint + for the disconnect user operation. + + Typically these are written to a http.Request. */ type DisconnectUserParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type DisconnectUserParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the disconnect user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DisconnectUserParams) WithDefaults() *DisconnectUserParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the disconnect user params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DisconnectUserParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the disconnect user params func (o *DisconnectUserParams) WithTimeout(timeout time.Duration) *DisconnectUserParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/disconnect_user_responses.go b/internal/httpclient/client/public/disconnect_user_responses.go index cba4856c5ef..e5a423481dd 100644 --- a/internal/httpclient/client/public/disconnect_user_responses.go +++ b/internal/httpclient/client/public/disconnect_user_responses.go @@ -26,9 +26,8 @@ func (o *DisconnectUserReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -37,9 +36,9 @@ func NewDisconnectUserFound() *DisconnectUserFound { return &DisconnectUserFound{} } -/*DisconnectUserFound handles this case with default header values. +/* DisconnectUserFound describes a response with status code 302, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DisconnectUserFound struct { diff --git a/internal/httpclient/client/public/discover_open_id_configuration_parameters.go b/internal/httpclient/client/public/discover_open_id_configuration_parameters.go index db24ed1492a..93ff41bb9a5 100644 --- a/internal/httpclient/client/public/discover_open_id_configuration_parameters.go +++ b/internal/httpclient/client/public/discover_open_id_configuration_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDiscoverOpenIDConfigurationParams creates a new DiscoverOpenIDConfigurationParams object -// with the default values initialized. +// NewDiscoverOpenIDConfigurationParams creates a new DiscoverOpenIDConfigurationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewDiscoverOpenIDConfigurationParams() *DiscoverOpenIDConfigurationParams { - return &DiscoverOpenIDConfigurationParams{ - timeout: cr.DefaultTimeout, } } // NewDiscoverOpenIDConfigurationParamsWithTimeout creates a new DiscoverOpenIDConfigurationParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewDiscoverOpenIDConfigurationParamsWithTimeout(timeout time.Duration) *DiscoverOpenIDConfigurationParams { - return &DiscoverOpenIDConfigurationParams{ - timeout: timeout, } } // NewDiscoverOpenIDConfigurationParamsWithContext creates a new DiscoverOpenIDConfigurationParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewDiscoverOpenIDConfigurationParamsWithContext(ctx context.Context) *DiscoverOpenIDConfigurationParams { - return &DiscoverOpenIDConfigurationParams{ - Context: ctx, } } // NewDiscoverOpenIDConfigurationParamsWithHTTPClient creates a new DiscoverOpenIDConfigurationParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewDiscoverOpenIDConfigurationParamsWithHTTPClient(client *http.Client) *DiscoverOpenIDConfigurationParams { - return &DiscoverOpenIDConfigurationParams{ HTTPClient: client, } } -/*DiscoverOpenIDConfigurationParams contains all the parameters to send to the API endpoint -for the discover open ID configuration operation typically these are written to a http.Request +/* DiscoverOpenIDConfigurationParams contains all the parameters to send to the API endpoint + for the discover open ID configuration operation. + + Typically these are written to a http.Request. */ type DiscoverOpenIDConfigurationParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type DiscoverOpenIDConfigurationParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the discover open ID configuration params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DiscoverOpenIDConfigurationParams) WithDefaults() *DiscoverOpenIDConfigurationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the discover open ID configuration params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DiscoverOpenIDConfigurationParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the discover open ID configuration params func (o *DiscoverOpenIDConfigurationParams) WithTimeout(timeout time.Duration) *DiscoverOpenIDConfigurationParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/discover_open_id_configuration_responses.go b/internal/httpclient/client/public/discover_open_id_configuration_responses.go index a3e7a6c5b7c..ad0e1e75fba 100644 --- a/internal/httpclient/client/public/discover_open_id_configuration_responses.go +++ b/internal/httpclient/client/public/discover_open_id_configuration_responses.go @@ -41,9 +41,8 @@ func (o *DiscoverOpenIDConfigurationReader) ReadResponse(response runtime.Client return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewDiscoverOpenIDConfigurationOK() *DiscoverOpenIDConfigurationOK { return &DiscoverOpenIDConfigurationOK{} } -/*DiscoverOpenIDConfigurationOK handles this case with default header values. +/* DiscoverOpenIDConfigurationOK describes a response with status code 200, with default header values. wellKnown */ @@ -63,7 +62,6 @@ type DiscoverOpenIDConfigurationOK struct { func (o *DiscoverOpenIDConfigurationOK) Error() string { return fmt.Sprintf("[GET /.well-known/openid-configuration][%d] discoverOpenIdConfigurationOK %+v", 200, o.Payload) } - func (o *DiscoverOpenIDConfigurationOK) GetPayload() *models.WellKnown { return o.Payload } @@ -85,7 +83,7 @@ func NewDiscoverOpenIDConfigurationUnauthorized() *DiscoverOpenIDConfigurationUn return &DiscoverOpenIDConfigurationUnauthorized{} } -/*DiscoverOpenIDConfigurationUnauthorized handles this case with default header values. +/* DiscoverOpenIDConfigurationUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -96,7 +94,6 @@ type DiscoverOpenIDConfigurationUnauthorized struct { func (o *DiscoverOpenIDConfigurationUnauthorized) Error() string { return fmt.Sprintf("[GET /.well-known/openid-configuration][%d] discoverOpenIdConfigurationUnauthorized %+v", 401, o.Payload) } - func (o *DiscoverOpenIDConfigurationUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -118,7 +115,7 @@ func NewDiscoverOpenIDConfigurationInternalServerError() *DiscoverOpenIDConfigur return &DiscoverOpenIDConfigurationInternalServerError{} } -/*DiscoverOpenIDConfigurationInternalServerError handles this case with default header values. +/* DiscoverOpenIDConfigurationInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -129,7 +126,6 @@ type DiscoverOpenIDConfigurationInternalServerError struct { func (o *DiscoverOpenIDConfigurationInternalServerError) Error() string { return fmt.Sprintf("[GET /.well-known/openid-configuration][%d] discoverOpenIdConfigurationInternalServerError %+v", 500, o.Payload) } - func (o *DiscoverOpenIDConfigurationInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/is_instance_ready_parameters.go b/internal/httpclient/client/public/is_instance_ready_parameters.go index b6ae09dcfd3..1d00d0188ae 100644 --- a/internal/httpclient/client/public/is_instance_ready_parameters.go +++ b/internal/httpclient/client/public/is_instance_ready_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIsInstanceReadyParams creates a new IsInstanceReadyParams object -// with the default values initialized. +// NewIsInstanceReadyParams creates a new IsInstanceReadyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewIsInstanceReadyParams() *IsInstanceReadyParams { - return &IsInstanceReadyParams{ - timeout: cr.DefaultTimeout, } } // NewIsInstanceReadyParamsWithTimeout creates a new IsInstanceReadyParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewIsInstanceReadyParamsWithTimeout(timeout time.Duration) *IsInstanceReadyParams { - return &IsInstanceReadyParams{ - timeout: timeout, } } // NewIsInstanceReadyParamsWithContext creates a new IsInstanceReadyParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewIsInstanceReadyParamsWithContext(ctx context.Context) *IsInstanceReadyParams { - return &IsInstanceReadyParams{ - Context: ctx, } } // NewIsInstanceReadyParamsWithHTTPClient creates a new IsInstanceReadyParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewIsInstanceReadyParamsWithHTTPClient(client *http.Client) *IsInstanceReadyParams { - return &IsInstanceReadyParams{ HTTPClient: client, } } -/*IsInstanceReadyParams contains all the parameters to send to the API endpoint -for the is instance ready operation typically these are written to a http.Request +/* IsInstanceReadyParams contains all the parameters to send to the API endpoint + for the is instance ready operation. + + Typically these are written to a http.Request. */ type IsInstanceReadyParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type IsInstanceReadyParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the is instance ready params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IsInstanceReadyParams) WithDefaults() *IsInstanceReadyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the is instance ready params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IsInstanceReadyParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the is instance ready params func (o *IsInstanceReadyParams) WithTimeout(timeout time.Duration) *IsInstanceReadyParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/is_instance_ready_responses.go b/internal/httpclient/client/public/is_instance_ready_responses.go index 2739bb4c847..e09081bd45b 100644 --- a/internal/httpclient/client/public/is_instance_ready_responses.go +++ b/internal/httpclient/client/public/is_instance_ready_responses.go @@ -35,9 +35,8 @@ func (o *IsInstanceReadyReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -46,7 +45,7 @@ func NewIsInstanceReadyOK() *IsInstanceReadyOK { return &IsInstanceReadyOK{} } -/*IsInstanceReadyOK handles this case with default header values. +/* IsInstanceReadyOK describes a response with status code 200, with default header values. healthStatus */ @@ -57,7 +56,6 @@ type IsInstanceReadyOK struct { func (o *IsInstanceReadyOK) Error() string { return fmt.Sprintf("[GET /health/ready][%d] isInstanceReadyOK %+v", 200, o.Payload) } - func (o *IsInstanceReadyOK) GetPayload() *models.HealthStatus { return o.Payload } @@ -79,7 +77,7 @@ func NewIsInstanceReadyServiceUnavailable() *IsInstanceReadyServiceUnavailable { return &IsInstanceReadyServiceUnavailable{} } -/*IsInstanceReadyServiceUnavailable handles this case with default header values. +/* IsInstanceReadyServiceUnavailable describes a response with status code 503, with default header values. healthNotReadyStatus */ @@ -90,7 +88,6 @@ type IsInstanceReadyServiceUnavailable struct { func (o *IsInstanceReadyServiceUnavailable) Error() string { return fmt.Sprintf("[GET /health/ready][%d] isInstanceReadyServiceUnavailable %+v", 503, o.Payload) } - func (o *IsInstanceReadyServiceUnavailable) GetPayload() *models.HealthNotReadyStatus { return o.Payload } diff --git a/internal/httpclient/client/public/oauth2_token_parameters.go b/internal/httpclient/client/public/oauth2_token_parameters.go index 6acc0424a20..c67d2e921e3 100644 --- a/internal/httpclient/client/public/oauth2_token_parameters.go +++ b/internal/httpclient/client/public/oauth2_token_parameters.go @@ -16,59 +16,62 @@ import ( "github.com/go-openapi/strfmt" ) -// NewOauth2TokenParams creates a new Oauth2TokenParams object -// with the default values initialized. +// NewOauth2TokenParams creates a new Oauth2TokenParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewOauth2TokenParams() *Oauth2TokenParams { - var () return &Oauth2TokenParams{ - timeout: cr.DefaultTimeout, } } // NewOauth2TokenParamsWithTimeout creates a new Oauth2TokenParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewOauth2TokenParamsWithTimeout(timeout time.Duration) *Oauth2TokenParams { - var () return &Oauth2TokenParams{ - timeout: timeout, } } // NewOauth2TokenParamsWithContext creates a new Oauth2TokenParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewOauth2TokenParamsWithContext(ctx context.Context) *Oauth2TokenParams { - var () return &Oauth2TokenParams{ - Context: ctx, } } // NewOauth2TokenParamsWithHTTPClient creates a new Oauth2TokenParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewOauth2TokenParamsWithHTTPClient(client *http.Client) *Oauth2TokenParams { - var () return &Oauth2TokenParams{ HTTPClient: client, } } -/*Oauth2TokenParams contains all the parameters to send to the API endpoint -for the oauth2 token operation typically these are written to a http.Request +/* Oauth2TokenParams contains all the parameters to send to the API endpoint + for the oauth2 token operation. + + Typically these are written to a http.Request. */ type Oauth2TokenParams struct { - /*ClientID*/ + // ClientID. ClientID *string - /*Code*/ + + // Code. Code *string - /*GrantType*/ + + // GrantType. GrantType string - /*RedirectURI*/ + + // RedirectURI. RedirectURI *string - /*RefreshToken*/ + + // RefreshToken. RefreshToken *string timeout time.Duration @@ -76,6 +79,21 @@ type Oauth2TokenParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the oauth2 token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *Oauth2TokenParams) WithDefaults() *Oauth2TokenParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the oauth2 token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *Oauth2TokenParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the oauth2 token params func (o *Oauth2TokenParams) WithTimeout(timeout time.Duration) *Oauth2TokenParams { o.SetTimeout(timeout) @@ -185,7 +203,6 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } - } if o.Code != nil { @@ -201,7 +218,6 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } - } // form param grant_type @@ -226,7 +242,6 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } - } if o.RefreshToken != nil { @@ -242,7 +257,6 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } - } if len(res) > 0 { diff --git a/internal/httpclient/client/public/oauth2_token_responses.go b/internal/httpclient/client/public/oauth2_token_responses.go index 1a0fe662680..72db050471a 100644 --- a/internal/httpclient/client/public/oauth2_token_responses.go +++ b/internal/httpclient/client/public/oauth2_token_responses.go @@ -47,9 +47,8 @@ func (o *Oauth2TokenReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -58,7 +57,7 @@ func NewOauth2TokenOK() *Oauth2TokenOK { return &Oauth2TokenOK{} } -/*Oauth2TokenOK handles this case with default header values. +/* Oauth2TokenOK describes a response with status code 200, with default header values. oauth2TokenResponse */ @@ -69,7 +68,6 @@ type Oauth2TokenOK struct { func (o *Oauth2TokenOK) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenOK %+v", 200, o.Payload) } - func (o *Oauth2TokenOK) GetPayload() *models.Oauth2TokenResponse { return o.Payload } @@ -91,7 +89,7 @@ func NewOauth2TokenBadRequest() *Oauth2TokenBadRequest { return &Oauth2TokenBadRequest{} } -/*Oauth2TokenBadRequest handles this case with default header values. +/* Oauth2TokenBadRequest describes a response with status code 400, with default header values. jsonError */ @@ -102,7 +100,6 @@ type Oauth2TokenBadRequest struct { func (o *Oauth2TokenBadRequest) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenBadRequest %+v", 400, o.Payload) } - func (o *Oauth2TokenBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -124,7 +121,7 @@ func NewOauth2TokenUnauthorized() *Oauth2TokenUnauthorized { return &Oauth2TokenUnauthorized{} } -/*Oauth2TokenUnauthorized handles this case with default header values. +/* Oauth2TokenUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -135,7 +132,6 @@ type Oauth2TokenUnauthorized struct { func (o *Oauth2TokenUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenUnauthorized %+v", 401, o.Payload) } - func (o *Oauth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -157,7 +153,7 @@ func NewOauth2TokenInternalServerError() *Oauth2TokenInternalServerError { return &Oauth2TokenInternalServerError{} } -/*Oauth2TokenInternalServerError handles this case with default header values. +/* Oauth2TokenInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -168,7 +164,6 @@ type Oauth2TokenInternalServerError struct { func (o *Oauth2TokenInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenInternalServerError %+v", 500, o.Payload) } - func (o *Oauth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/oauth_auth_parameters.go b/internal/httpclient/client/public/oauth_auth_parameters.go index 4476b6a7414..46f21005985 100644 --- a/internal/httpclient/client/public/oauth_auth_parameters.go +++ b/internal/httpclient/client/public/oauth_auth_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewOauthAuthParams creates a new OauthAuthParams object -// with the default values initialized. +// NewOauthAuthParams creates a new OauthAuthParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewOauthAuthParams() *OauthAuthParams { - return &OauthAuthParams{ - timeout: cr.DefaultTimeout, } } // NewOauthAuthParamsWithTimeout creates a new OauthAuthParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewOauthAuthParamsWithTimeout(timeout time.Duration) *OauthAuthParams { - return &OauthAuthParams{ - timeout: timeout, } } // NewOauthAuthParamsWithContext creates a new OauthAuthParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewOauthAuthParamsWithContext(ctx context.Context) *OauthAuthParams { - return &OauthAuthParams{ - Context: ctx, } } // NewOauthAuthParamsWithHTTPClient creates a new OauthAuthParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewOauthAuthParamsWithHTTPClient(client *http.Client) *OauthAuthParams { - return &OauthAuthParams{ HTTPClient: client, } } -/*OauthAuthParams contains all the parameters to send to the API endpoint -for the oauth auth operation typically these are written to a http.Request +/* OauthAuthParams contains all the parameters to send to the API endpoint + for the oauth auth operation. + + Typically these are written to a http.Request. */ type OauthAuthParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type OauthAuthParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the oauth auth params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *OauthAuthParams) WithDefaults() *OauthAuthParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the oauth auth params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *OauthAuthParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the oauth auth params func (o *OauthAuthParams) WithTimeout(timeout time.Duration) *OauthAuthParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/oauth_auth_responses.go b/internal/httpclient/client/public/oauth_auth_responses.go index ad4a379f4c2..7a0a3477b9d 100644 --- a/internal/httpclient/client/public/oauth_auth_responses.go +++ b/internal/httpclient/client/public/oauth_auth_responses.go @@ -41,9 +41,8 @@ func (o *OauthAuthReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,9 +51,9 @@ func NewOauthAuthFound() *OauthAuthFound { return &OauthAuthFound{} } -/*OauthAuthFound handles this case with default header values. +/* OauthAuthFound describes a response with status code 302, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type OauthAuthFound struct { @@ -74,7 +73,7 @@ func NewOauthAuthUnauthorized() *OauthAuthUnauthorized { return &OauthAuthUnauthorized{} } -/*OauthAuthUnauthorized handles this case with default header values. +/* OauthAuthUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -85,7 +84,6 @@ type OauthAuthUnauthorized struct { func (o *OauthAuthUnauthorized) Error() string { return fmt.Sprintf("[GET /oauth2/auth][%d] oauthAuthUnauthorized %+v", 401, o.Payload) } - func (o *OauthAuthUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -107,7 +105,7 @@ func NewOauthAuthInternalServerError() *OauthAuthInternalServerError { return &OauthAuthInternalServerError{} } -/*OauthAuthInternalServerError handles this case with default header values. +/* OauthAuthInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -118,7 +116,6 @@ type OauthAuthInternalServerError struct { func (o *OauthAuthInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth][%d] oauthAuthInternalServerError %+v", 500, o.Payload) } - func (o *OauthAuthInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/public_client.go b/internal/httpclient/client/public/public_client.go index c5e30ab557d..31a6c56117c 100644 --- a/internal/httpclient/client/public/public_client.go +++ b/internal/httpclient/client/public/public_client.go @@ -25,27 +25,122 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - DisconnectUser(params *DisconnectUserParams) error + CreateOAuth2ClientPublic(params *CreateOAuth2ClientPublicParams, opts ...ClientOption) (*CreateOAuth2ClientPublicCreated, error) + + DeleteOAuth2ClientPublic(params *DeleteOAuth2ClientPublicParams, opts ...ClientOption) (*DeleteOAuth2ClientPublicNoContent, error) + + DisconnectUser(params *DisconnectUserParams, opts ...ClientOption) error + + DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams, opts ...ClientOption) (*DiscoverOpenIDConfigurationOK, error) + + GetOAuth2ClientPublic(params *GetOAuth2ClientPublicParams, opts ...ClientOption) (*GetOAuth2ClientPublicOK, error) - DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams) (*DiscoverOpenIDConfigurationOK, error) + IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOption) (*IsInstanceReadyOK, error) - IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceReadyOK, error) + Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*Oauth2TokenOK, error) - Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*Oauth2TokenOK, error) + OauthAuth(params *OauthAuthParams, opts ...ClientOption) error - OauthAuth(params *OauthAuthParams) error + RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeOAuth2TokenOK, error) - RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeOAuth2TokenOK, error) + UpdateOAuth2ClientPublic(params *UpdateOAuth2ClientPublicParams, opts ...ClientOption) (*UpdateOAuth2ClientPublicOK, error) - Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter) (*UserinfoOK, error) + Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UserinfoOK, error) - WellKnown(params *WellKnownParams) (*WellKnownOK, error) + WellKnown(params *WellKnownParams, opts ...ClientOption) (*WellKnownOK, error) SetTransport(transport runtime.ClientTransport) } +/* + CreateOAuth2ClientPublic creates an o auth 2 0 client + + Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. +*/ +func (a *Client) CreateOAuth2ClientPublic(params *CreateOAuth2ClientPublicParams, opts ...ClientOption) (*CreateOAuth2ClientPublicCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateOAuth2ClientPublicParams() + } + op := &runtime.ClientOperation{ + ID: "createOAuth2ClientPublic", + Method: "POST", + PathPattern: "/connect/register", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &CreateOAuth2ClientPublicReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateOAuth2ClientPublicCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeleteOAuth2ClientPublic deletes an o auth 2 0 client + + Delete an existing OAuth 2.0 Client by its ID. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. +*/ +func (a *Client) DeleteOAuth2ClientPublic(params *DeleteOAuth2ClientPublicParams, opts ...ClientOption) (*DeleteOAuth2ClientPublicNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteOAuth2ClientPublicParams() + } + op := &runtime.ClientOperation{ + ID: "deleteOAuth2ClientPublic", + Method: "DELETE", + PathPattern: "/connect/register", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &DeleteOAuth2ClientPublicReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteOAuth2ClientPublicNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* DisconnectUser opens ID connect front backchannel enabled logout @@ -54,13 +149,12 @@ type ClientService interface { https://openid.net/specs/openid-connect-frontchannel-1_0.html https://openid.net/specs/openid-connect-backchannel-1_0.html */ -func (a *Client) DisconnectUser(params *DisconnectUserParams) error { +func (a *Client) DisconnectUser(params *DisconnectUserParams, opts ...ClientOption) error { // TODO: Validate the params before sending if params == nil { params = NewDisconnectUserParams() } - - _, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "disconnectUser", Method: "GET", PathPattern: "/oauth2/sessions/logout", @@ -71,7 +165,12 @@ func (a *Client) DisconnectUser(params *DisconnectUserParams) error { Reader: &DisconnectUserReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) if err != nil { return err } @@ -88,13 +187,12 @@ flow at https://openid.net/specs/openid-connect-discovery-1_0.html . Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang), and others. For a full list of clients go here: https://openid.net/developers/certified/ */ -func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams) (*DiscoverOpenIDConfigurationOK, error) { +func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams, opts ...ClientOption) (*DiscoverOpenIDConfigurationOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDiscoverOpenIDConfigurationParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "discoverOpenIDConfiguration", Method: "GET", PathPattern: "/.well-known/openid-configuration", @@ -105,7 +203,12 @@ func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfiguration Reader: &DiscoverOpenIDConfigurationReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -119,6 +222,48 @@ func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfiguration panic(msg) } +/* + GetOAuth2ClientPublic gets an o auth 2 0 client + + Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. +*/ +func (a *Client) GetOAuth2ClientPublic(params *GetOAuth2ClientPublicParams, opts ...ClientOption) (*GetOAuth2ClientPublicOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetOAuth2ClientPublicParams() + } + op := &runtime.ClientOperation{ + ID: "getOAuth2ClientPublic", + Method: "GET", + PathPattern: "/connect/register", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetOAuth2ClientPublicReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetOAuth2ClientPublicOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* IsInstanceReady checks readiness status @@ -131,13 +276,12 @@ If the service supports TLS Edge Termination, this endpoint does not require the Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance. */ -func (a *Client) IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceReadyOK, error) { +func (a *Client) IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOption) (*IsInstanceReadyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewIsInstanceReadyParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "isInstanceReady", Method: "GET", PathPattern: "/health/ready", @@ -148,7 +292,12 @@ func (a *Client) IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceRead Reader: &IsInstanceReadyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -174,13 +323,12 @@ request entity-body. > > Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed above! */ -func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*Oauth2TokenOK, error) { +func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*Oauth2TokenOK, error) { // TODO: Validate the params before sending if params == nil { params = NewOauth2TokenParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "oauth2Token", Method: "POST", PathPattern: "/oauth2/token", @@ -192,7 +340,12 @@ func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientA AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -214,13 +367,12 @@ OAuth2 is a very popular protocol and a library for your programming language wi To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749 */ -func (a *Client) OauthAuth(params *OauthAuthParams) error { +func (a *Client) OauthAuth(params *OauthAuthParams, opts ...ClientOption) error { // TODO: Validate the params before sending if params == nil { params = NewOauthAuthParams() } - - _, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "oauthAuth", Method: "GET", PathPattern: "/oauth2/auth", @@ -231,7 +383,12 @@ func (a *Client) OauthAuth(params *OauthAuthParams) error { Reader: &OauthAuthReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) if err != nil { return err } @@ -246,13 +403,12 @@ longer be used to make access requests, and a revoked refresh token can no longe Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for. */ -func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeOAuth2TokenOK, error) { +func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeOAuth2TokenOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRevokeOAuth2TokenParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "revokeOAuth2Token", Method: "POST", PathPattern: "/oauth2/revoke", @@ -264,7 +420,12 @@ func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo run AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -278,6 +439,48 @@ func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo run panic(msg) } +/* + UpdateOAuth2ClientPublic updates an o auth 2 0 client + + Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. +*/ +func (a *Client) UpdateOAuth2ClientPublic(params *UpdateOAuth2ClientPublicParams, opts ...ClientOption) (*UpdateOAuth2ClientPublicOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateOAuth2ClientPublicParams() + } + op := &runtime.ClientOperation{ + ID: "updateOAuth2ClientPublic", + Method: "PUT", + PathPattern: "/connect/register", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &UpdateOAuth2ClientPublicReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateOAuth2ClientPublicOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* Userinfo opens ID connect userinfo @@ -290,13 +493,12 @@ In the case of authentication error, a WWW-Authenticate header might be set in t with more information about the error. See [the spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3) for more details about header format. */ -func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter) (*UserinfoOK, error) { +func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UserinfoOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUserinfoParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "userinfo", Method: "GET", PathPattern: "/userinfo", @@ -308,7 +510,12 @@ func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInf AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -329,13 +536,12 @@ func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInf if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like [node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others. */ -func (a *Client) WellKnown(params *WellKnownParams) (*WellKnownOK, error) { +func (a *Client) WellKnown(params *WellKnownParams, opts ...ClientOption) (*WellKnownOK, error) { // TODO: Validate the params before sending if params == nil { params = NewWellKnownParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "wellKnown", Method: "GET", PathPattern: "/.well-known/jwks.json", @@ -346,7 +552,12 @@ func (a *Client) WellKnown(params *WellKnownParams) (*WellKnownOK, error) { Reader: &WellKnownReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go b/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go index 782c6be73b8..8a67b4b2903 100644 --- a/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go +++ b/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go @@ -16,51 +16,50 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRevokeOAuth2TokenParams creates a new RevokeOAuth2TokenParams object -// with the default values initialized. +// NewRevokeOAuth2TokenParams creates a new RevokeOAuth2TokenParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewRevokeOAuth2TokenParams() *RevokeOAuth2TokenParams { - var () return &RevokeOAuth2TokenParams{ - timeout: cr.DefaultTimeout, } } // NewRevokeOAuth2TokenParamsWithTimeout creates a new RevokeOAuth2TokenParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewRevokeOAuth2TokenParamsWithTimeout(timeout time.Duration) *RevokeOAuth2TokenParams { - var () return &RevokeOAuth2TokenParams{ - timeout: timeout, } } // NewRevokeOAuth2TokenParamsWithContext creates a new RevokeOAuth2TokenParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewRevokeOAuth2TokenParamsWithContext(ctx context.Context) *RevokeOAuth2TokenParams { - var () return &RevokeOAuth2TokenParams{ - Context: ctx, } } // NewRevokeOAuth2TokenParamsWithHTTPClient creates a new RevokeOAuth2TokenParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewRevokeOAuth2TokenParamsWithHTTPClient(client *http.Client) *RevokeOAuth2TokenParams { - var () return &RevokeOAuth2TokenParams{ HTTPClient: client, } } -/*RevokeOAuth2TokenParams contains all the parameters to send to the API endpoint -for the revoke o auth2 token operation typically these are written to a http.Request +/* RevokeOAuth2TokenParams contains all the parameters to send to the API endpoint + for the revoke o auth2 token operation. + + Typically these are written to a http.Request. */ type RevokeOAuth2TokenParams struct { - /*Token*/ + // Token. Token string timeout time.Duration @@ -68,6 +67,21 @@ type RevokeOAuth2TokenParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the revoke o auth2 token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeOAuth2TokenParams) WithDefaults() *RevokeOAuth2TokenParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the revoke o auth2 token params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeOAuth2TokenParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the revoke o auth2 token params func (o *RevokeOAuth2TokenParams) WithTimeout(timeout time.Duration) *RevokeOAuth2TokenParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/revoke_o_auth2_token_responses.go b/internal/httpclient/client/public/revoke_o_auth2_token_responses.go index 1e058d9b063..3e34c0a0645 100644 --- a/internal/httpclient/client/public/revoke_o_auth2_token_responses.go +++ b/internal/httpclient/client/public/revoke_o_auth2_token_responses.go @@ -41,9 +41,8 @@ func (o *RevokeOAuth2TokenReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,9 +51,9 @@ func NewRevokeOAuth2TokenOK() *RevokeOAuth2TokenOK { return &RevokeOAuth2TokenOK{} } -/*RevokeOAuth2TokenOK handles this case with default header values. +/* RevokeOAuth2TokenOK describes a response with status code 200, with default header values. -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is + Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RevokeOAuth2TokenOK struct { @@ -74,7 +73,7 @@ func NewRevokeOAuth2TokenUnauthorized() *RevokeOAuth2TokenUnauthorized { return &RevokeOAuth2TokenUnauthorized{} } -/*RevokeOAuth2TokenUnauthorized handles this case with default header values. +/* RevokeOAuth2TokenUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -85,7 +84,6 @@ type RevokeOAuth2TokenUnauthorized struct { func (o *RevokeOAuth2TokenUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/revoke][%d] revokeOAuth2TokenUnauthorized %+v", 401, o.Payload) } - func (o *RevokeOAuth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -107,7 +105,7 @@ func NewRevokeOAuth2TokenInternalServerError() *RevokeOAuth2TokenInternalServerE return &RevokeOAuth2TokenInternalServerError{} } -/*RevokeOAuth2TokenInternalServerError handles this case with default header values. +/* RevokeOAuth2TokenInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -118,7 +116,6 @@ type RevokeOAuth2TokenInternalServerError struct { func (o *RevokeOAuth2TokenInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/revoke][%d] revokeOAuth2TokenInternalServerError %+v", 500, o.Payload) } - func (o *RevokeOAuth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/userinfo_parameters.go b/internal/httpclient/client/public/userinfo_parameters.go index f9028b8ec43..03b3ad50f4b 100644 --- a/internal/httpclient/client/public/userinfo_parameters.go +++ b/internal/httpclient/client/public/userinfo_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUserinfoParams creates a new UserinfoParams object -// with the default values initialized. +// NewUserinfoParams creates a new UserinfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewUserinfoParams() *UserinfoParams { - return &UserinfoParams{ - timeout: cr.DefaultTimeout, } } // NewUserinfoParamsWithTimeout creates a new UserinfoParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewUserinfoParamsWithTimeout(timeout time.Duration) *UserinfoParams { - return &UserinfoParams{ - timeout: timeout, } } // NewUserinfoParamsWithContext creates a new UserinfoParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewUserinfoParamsWithContext(ctx context.Context) *UserinfoParams { - return &UserinfoParams{ - Context: ctx, } } // NewUserinfoParamsWithHTTPClient creates a new UserinfoParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewUserinfoParamsWithHTTPClient(client *http.Client) *UserinfoParams { - return &UserinfoParams{ HTTPClient: client, } } -/*UserinfoParams contains all the parameters to send to the API endpoint -for the userinfo operation typically these are written to a http.Request +/* UserinfoParams contains all the parameters to send to the API endpoint + for the userinfo operation. + + Typically these are written to a http.Request. */ type UserinfoParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type UserinfoParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the userinfo params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UserinfoParams) WithDefaults() *UserinfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the userinfo params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UserinfoParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the userinfo params func (o *UserinfoParams) WithTimeout(timeout time.Duration) *UserinfoParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/userinfo_responses.go b/internal/httpclient/client/public/userinfo_responses.go index 14a27428726..7a7f9cd033b 100644 --- a/internal/httpclient/client/public/userinfo_responses.go +++ b/internal/httpclient/client/public/userinfo_responses.go @@ -41,9 +41,8 @@ func (o *UserinfoReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -52,7 +51,7 @@ func NewUserinfoOK() *UserinfoOK { return &UserinfoOK{} } -/*UserinfoOK handles this case with default header values. +/* UserinfoOK describes a response with status code 200, with default header values. userinfoResponse */ @@ -63,7 +62,6 @@ type UserinfoOK struct { func (o *UserinfoOK) Error() string { return fmt.Sprintf("[GET /userinfo][%d] userinfoOK %+v", 200, o.Payload) } - func (o *UserinfoOK) GetPayload() *models.UserinfoResponse { return o.Payload } @@ -85,7 +83,7 @@ func NewUserinfoUnauthorized() *UserinfoUnauthorized { return &UserinfoUnauthorized{} } -/*UserinfoUnauthorized handles this case with default header values. +/* UserinfoUnauthorized describes a response with status code 401, with default header values. jsonError */ @@ -96,7 +94,6 @@ type UserinfoUnauthorized struct { func (o *UserinfoUnauthorized) Error() string { return fmt.Sprintf("[GET /userinfo][%d] userinfoUnauthorized %+v", 401, o.Payload) } - func (o *UserinfoUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -118,7 +115,7 @@ func NewUserinfoInternalServerError() *UserinfoInternalServerError { return &UserinfoInternalServerError{} } -/*UserinfoInternalServerError handles this case with default header values. +/* UserinfoInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -129,7 +126,6 @@ type UserinfoInternalServerError struct { func (o *UserinfoInternalServerError) Error() string { return fmt.Sprintf("[GET /userinfo][%d] userinfoInternalServerError %+v", 500, o.Payload) } - func (o *UserinfoInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/well_known_parameters.go b/internal/httpclient/client/public/well_known_parameters.go index 206f42be2d7..b9b34518e5b 100644 --- a/internal/httpclient/client/public/well_known_parameters.go +++ b/internal/httpclient/client/public/well_known_parameters.go @@ -16,47 +16,46 @@ import ( "github.com/go-openapi/strfmt" ) -// NewWellKnownParams creates a new WellKnownParams object -// with the default values initialized. +// NewWellKnownParams creates a new WellKnownParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewWellKnownParams() *WellKnownParams { - return &WellKnownParams{ - timeout: cr.DefaultTimeout, } } // NewWellKnownParamsWithTimeout creates a new WellKnownParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewWellKnownParamsWithTimeout(timeout time.Duration) *WellKnownParams { - return &WellKnownParams{ - timeout: timeout, } } // NewWellKnownParamsWithContext creates a new WellKnownParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewWellKnownParamsWithContext(ctx context.Context) *WellKnownParams { - return &WellKnownParams{ - Context: ctx, } } // NewWellKnownParamsWithHTTPClient creates a new WellKnownParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewWellKnownParamsWithHTTPClient(client *http.Client) *WellKnownParams { - return &WellKnownParams{ HTTPClient: client, } } -/*WellKnownParams contains all the parameters to send to the API endpoint -for the well known operation typically these are written to a http.Request +/* WellKnownParams contains all the parameters to send to the API endpoint + for the well known operation. + + Typically these are written to a http.Request. */ type WellKnownParams struct { timeout time.Duration @@ -64,6 +63,21 @@ type WellKnownParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the well known params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WellKnownParams) WithDefaults() *WellKnownParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the well known params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WellKnownParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the well known params func (o *WellKnownParams) WithTimeout(timeout time.Duration) *WellKnownParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/well_known_responses.go b/internal/httpclient/client/public/well_known_responses.go index 8182a40c516..2d0a35e587c 100644 --- a/internal/httpclient/client/public/well_known_responses.go +++ b/internal/httpclient/client/public/well_known_responses.go @@ -35,9 +35,8 @@ func (o *WellKnownReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -46,7 +45,7 @@ func NewWellKnownOK() *WellKnownOK { return &WellKnownOK{} } -/*WellKnownOK handles this case with default header values. +/* WellKnownOK describes a response with status code 200, with default header values. JSONWebKeySet */ @@ -57,7 +56,6 @@ type WellKnownOK struct { func (o *WellKnownOK) Error() string { return fmt.Sprintf("[GET /.well-known/jwks.json][%d] wellKnownOK %+v", 200, o.Payload) } - func (o *WellKnownOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -79,7 +77,7 @@ func NewWellKnownInternalServerError() *WellKnownInternalServerError { return &WellKnownInternalServerError{} } -/*WellKnownInternalServerError handles this case with default header values. +/* WellKnownInternalServerError describes a response with status code 500, with default header values. jsonError */ @@ -90,7 +88,6 @@ type WellKnownInternalServerError struct { func (o *WellKnownInternalServerError) Error() string { return fmt.Sprintf("[GET /.well-known/jwks.json][%d] wellKnownInternalServerError %+v", 500, o.Payload) } - func (o *WellKnownInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/models/accept_consent_request.go b/internal/httpclient/models/accept_consent_request.go index 89d31c9c64a..2d2123225fa 100644 --- a/internal/httpclient/models/accept_consent_request.go +++ b/internal/httpclient/models/accept_consent_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -65,7 +67,6 @@ func (m *AcceptConsentRequest) Validate(formats strfmt.Registry) error { } func (m *AcceptConsentRequest) validateGrantAccessTokenAudience(formats strfmt.Registry) error { - if swag.IsZero(m.GrantAccessTokenAudience) { // not required return nil } @@ -81,7 +82,6 @@ func (m *AcceptConsentRequest) validateGrantAccessTokenAudience(formats strfmt.R } func (m *AcceptConsentRequest) validateGrantScope(formats strfmt.Registry) error { - if swag.IsZero(m.GrantScope) { // not required return nil } @@ -97,7 +97,6 @@ func (m *AcceptConsentRequest) validateGrantScope(formats strfmt.Registry) error } func (m *AcceptConsentRequest) validateHandledAt(formats strfmt.Registry) error { - if swag.IsZero(m.HandledAt) { // not required return nil } @@ -113,7 +112,6 @@ func (m *AcceptConsentRequest) validateHandledAt(formats strfmt.Registry) error } func (m *AcceptConsentRequest) validateSession(formats strfmt.Registry) error { - if swag.IsZero(m.Session) { // not required return nil } @@ -130,6 +128,82 @@ func (m *AcceptConsentRequest) validateSession(formats strfmt.Registry) error { return nil } +// ContextValidate validate this accept consent request based on the context it is used +func (m *AcceptConsentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateGrantAccessTokenAudience(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrantScope(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHandledAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSession(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AcceptConsentRequest) contextValidateGrantAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { + + if err := m.GrantAccessTokenAudience.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grant_access_token_audience") + } + return err + } + + return nil +} + +func (m *AcceptConsentRequest) contextValidateGrantScope(ctx context.Context, formats strfmt.Registry) error { + + if err := m.GrantScope.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grant_scope") + } + return err + } + + return nil +} + +func (m *AcceptConsentRequest) contextValidateHandledAt(ctx context.Context, formats strfmt.Registry) error { + + if err := m.HandledAt.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("handled_at") + } + return err + } + + return nil +} + +func (m *AcceptConsentRequest) contextValidateSession(ctx context.Context, formats strfmt.Registry) error { + + if m.Session != nil { + if err := m.Session.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("session") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *AcceptConsentRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/accept_login_request.go b/internal/httpclient/models/accept_login_request.go index 4eae3c7ccc3..55d0afbea5f 100644 --- a/internal/httpclient/models/accept_login_request.go +++ b/internal/httpclient/models/accept_login_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -80,6 +82,11 @@ func (m *AcceptLoginRequest) validateSubject(formats strfmt.Registry) error { return nil } +// ContextValidate validates this accept login request based on context it is used +func (m *AcceptLoginRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *AcceptLoginRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/completed_request.go b/internal/httpclient/models/completed_request.go index ea54e898220..2878fd455ba 100644 --- a/internal/httpclient/models/completed_request.go +++ b/internal/httpclient/models/completed_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -45,6 +47,11 @@ func (m *CompletedRequest) validateRedirectTo(formats strfmt.Registry) error { return nil } +// ContextValidate validates this completed request based on context it is used +func (m *CompletedRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *CompletedRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/consent_request.go b/internal/httpclient/models/consent_request.go index 64498026133..c048fbbdcfe 100644 --- a/internal/httpclient/models/consent_request.go +++ b/internal/httpclient/models/consent_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -106,7 +108,6 @@ func (m *ConsentRequest) validateChallenge(formats strfmt.Registry) error { } func (m *ConsentRequest) validateClient(formats strfmt.Registry) error { - if swag.IsZero(m.Client) { // not required return nil } @@ -124,7 +125,6 @@ func (m *ConsentRequest) validateClient(formats strfmt.Registry) error { } func (m *ConsentRequest) validateOidcContext(formats strfmt.Registry) error { - if swag.IsZero(m.OidcContext) { // not required return nil } @@ -142,7 +142,6 @@ func (m *ConsentRequest) validateOidcContext(formats strfmt.Registry) error { } func (m *ConsentRequest) validateRequestedAccessTokenAudience(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedAccessTokenAudience) { // not required return nil } @@ -158,7 +157,6 @@ func (m *ConsentRequest) validateRequestedAccessTokenAudience(formats strfmt.Reg } func (m *ConsentRequest) validateRequestedScope(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedScope) { // not required return nil } @@ -173,6 +171,84 @@ func (m *ConsentRequest) validateRequestedScope(formats strfmt.Registry) error { return nil } +// ContextValidate validate this consent request based on the context it is used +func (m *ConsentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClient(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOidcContext(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedAccessTokenAudience(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedScope(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsentRequest) contextValidateClient(ctx context.Context, formats strfmt.Registry) error { + + if m.Client != nil { + if err := m.Client.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("client") + } + return err + } + } + + return nil +} + +func (m *ConsentRequest) contextValidateOidcContext(ctx context.Context, formats strfmt.Registry) error { + + if m.OidcContext != nil { + if err := m.OidcContext.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oidc_context") + } + return err + } + } + + return nil +} + +func (m *ConsentRequest) contextValidateRequestedAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RequestedAccessTokenAudience.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requested_access_token_audience") + } + return err + } + + return nil +} + +func (m *ConsentRequest) contextValidateRequestedScope(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RequestedScope.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requested_scope") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ConsentRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/consent_request_session.go b/internal/httpclient/models/consent_request_session.go index 0cd2ae45dac..eaab7a24543 100644 --- a/internal/httpclient/models/consent_request_session.go +++ b/internal/httpclient/models/consent_request_session.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -31,6 +33,11 @@ func (m *ConsentRequestSession) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this consent request session based on context it is used +func (m *ConsentRequestSession) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ConsentRequestSession) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/container_wait_o_k_body_error.go b/internal/httpclient/models/container_wait_o_k_body_error.go index cc8113bb2a5..70637b4ce65 100644 --- a/internal/httpclient/models/container_wait_o_k_body_error.go +++ b/internal/httpclient/models/container_wait_o_k_body_error.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *ContainerWaitOKBodyError) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this container wait o k body error based on context it is used +func (m *ContainerWaitOKBodyError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ContainerWaitOKBodyError) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go b/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go index 6bd161403a9..42c82eff485 100644 --- a/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go +++ b/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -38,7 +40,6 @@ func (m *FlushInactiveOAuth2TokensRequest) Validate(formats strfmt.Registry) err } func (m *FlushInactiveOAuth2TokensRequest) validateNotAfter(formats strfmt.Registry) error { - if swag.IsZero(m.NotAfter) { // not required return nil } @@ -50,6 +51,11 @@ func (m *FlushInactiveOAuth2TokensRequest) validateNotAfter(formats strfmt.Regis return nil } +// ContextValidate validates this flush inactive o auth2 tokens request based on context it is used +func (m *FlushInactiveOAuth2TokensRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *FlushInactiveOAuth2TokensRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/health_not_ready_status.go b/internal/httpclient/models/health_not_ready_status.go index 64626783ed4..bab6d3873e8 100644 --- a/internal/httpclient/models/health_not_ready_status.go +++ b/internal/httpclient/models/health_not_ready_status.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *HealthNotReadyStatus) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this health not ready status based on context it is used +func (m *HealthNotReadyStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *HealthNotReadyStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/health_status.go b/internal/httpclient/models/health_status.go index 60ba32416b0..5525dbc20ea 100644 --- a/internal/httpclient/models/health_status.go +++ b/internal/httpclient/models/health_status.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *HealthStatus) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this health status based on context it is used +func (m *HealthStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *HealthStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_error.go b/internal/httpclient/models/json_error.go index 9819ea3551e..5bd88f6e897 100644 --- a/internal/httpclient/models/json_error.go +++ b/internal/httpclient/models/json_error.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -18,15 +20,19 @@ import ( type JSONError struct { // Name is the error name. + // Example: The requested resource could not be found Error string `json:"error,omitempty"` // Debug contains debug information. This is usually not available and has to be enabled. + // Example: The database adapter was unable to find the element ErrorDebug string `json:"error_debug,omitempty"` // Description contains further information on the nature of the error. + // Example: Object with ID 12345 does not exist ErrorDescription string `json:"error_description,omitempty"` // Code represents the error status code (404, 403, 401, ...). + // Example: 404 StatusCode int64 `json:"status_code,omitempty"` } @@ -35,6 +41,11 @@ func (m *JSONError) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this json error based on context it is used +func (m *JSONError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *JSONError) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_web_key.go b/internal/httpclient/models/json_web_key.go index 737cde8d02d..53f9bca2f92 100644 --- a/internal/httpclient/models/json_web_key.go +++ b/internal/httpclient/models/json_web_key.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -24,25 +26,32 @@ type JSONWebKey struct { // IANA "JSON Web Signature and Encryption Algorithms" registry // established by [JWA] or be a value that contains a Collision- // Resistant Name. + // Example: RS256 // Required: true Alg *string `json:"alg"` // crv + // Example: P-256 Crv string `json:"crv,omitempty"` // d + // Example: T_N8I-6He3M8a7X1vWt6TGIx4xB_GP3Mb4SsZSA4v-orvJzzRiQhLlRR81naWYxfQAYt5isDI6_C2L9bdWo4FFPjGQFvNoRX-_sBJyBI_rl-TBgsZYoUlAj3J92WmY2inbA-PwyJfsaIIDceYBC-eX-xiCu6qMqkZi3MwQAFL6bMdPEM0z4JBcwFT3VdiWAIRUuACWQwrXMq672x7fMuaIaHi7XDGgt1ith23CLfaREmJku9PQcchbt_uEY-hqrFY6ntTtS4paWWQj86xLL94S-Tf6v6xkL918PfLSOTq6XCzxvlFwzBJqApnAhbwqLjpPhgUG04EDRrqrSBc5Y1BLevn6Ip5h1AhessBp3wLkQgz_roeckt-ybvzKTjESMuagnpqLvOT7Y9veIug2MwPJZI2VjczRc1vzMs25XrFQ8DpUy-bNdp89TmvAXwctUMiJdgHloJw23Cv03gIUAkDnsTqZmkpbIf-crpgNKFmQP_EDKoe8p_PXZZgfbRri3NoEVGP7Mk6yEu8LjJhClhZaBNjuWw2-KlBfOA3g79mhfBnkInee5KO9mGR50qPk1V-MorUYNTFMZIm0kFE6eYVWFBwJHLKYhHU34DoiK1VP-svZpC2uAMFNA_UJEwM9CQ2b8qe4-5e9aywMvwcuArRkAB5mBIfOaOJao3mfukKAE D string `json:"d,omitempty"` // dp + // Example: G4sPXkc6Ya9y8oJW9_ILj4xuppu0lzi_H7VTkS8xj5SdX3coE0oimYwxIi2emTAue0UOa5dpgFGyBJ4c8tQ2VF402XRugKDTP8akYhFo5tAA77Qe_NmtuYZc3C3m3I24G2GvR5sSDxUyAN2zq8Lfn9EUms6rY3Ob8YeiKkTiBj0 Dp string `json:"dp,omitempty"` // dq + // Example: s9lAH9fggBsoFR8Oac2R_E2gw282rT2kGOAhvIllETE1efrA6huUUvMfBcMpn8lqeW6vzznYY5SSQF7pMdC_agI3nG8Ibp1BUb0JUiraRNqUfLhcQb_d9GF4Dh7e74WbRsobRonujTYN1xCaP6TO61jvWrX-L18txXw494Q_cgk Dq string `json:"dq,omitempty"` // e + // Example: AQAB E string `json:"e,omitempty"` // k + // Example: GawgguFyGrWKav7AX4VKUg K string `json:"k,omitempty"` // The "kid" (key ID) parameter is used to match a specific key. This @@ -54,6 +63,7 @@ type JSONWebKey struct { // they have different "kty" (key type) values but are considered to be // equivalent alternatives by the application using them.) The "kid" // value is a case-sensitive string. + // Example: 1603dfe0af8f4596 // Required: true Kid *string `json:"kid"` @@ -62,29 +72,36 @@ type JSONWebKey struct { // either be registered in the IANA "JSON Web Key Types" registry // established by [JWA] or be a value that contains a Collision- // Resistant Name. The "kty" value is a case-sensitive string. + // Example: RSA // Required: true Kty *string `json:"kty"` // n + // Example: vTqrxUyQPl_20aqf5kXHwDZrel-KovIp8s7ewJod2EXHl8tWlRB3_Rem34KwBfqlKQGp1nqah-51H4Jzruqe0cFP58hPEIt6WqrvnmJCXxnNuIB53iX_uUUXXHDHBeaPCSRoNJzNysjoJ30TIUsKBiirhBa7f235PXbKiHducLevV6PcKxJ5cY8zO286qJLBWSPm-OIevwqsIsSIH44Qtm9sioFikhkbLwoqwWORGAY0nl6XvVOlhADdLjBSqSAeT1FPuCDCnXwzCDR8N9IFB_IjdStFkC-rVt2K5BYfPd0c3yFp_vHR15eRd0zJ8XQ7woBC8Vnsac6Et1pKS59pX6256DPWu8UDdEOolKAPgcd_g2NpA76cAaF_jcT80j9KrEzw8Tv0nJBGesuCjPNjGs_KzdkWTUXt23Hn9QJsdc1MZuaW0iqXBepHYfYoqNelzVte117t4BwVp0kUM6we0IqyXClaZgOI8S-WDBw2_Ovdm8e5NmhYAblEVoygcX8Y46oH6bKiaCQfKCFDMcRgChme7AoE1yZZYsPbaG_3IjPrC4LBMHQw8rM9dWjJ8ImjicvZ1pAm0dx-KHCP3y5PVKrxBDf1zSOsBRkOSjB8TPODnJMz6-jd5hTtZxpZPwPoIdCanTZ3ZD6uRBpTmDwtpRGm63UQs1m5FWPwb0T2IF0 N string `json:"n,omitempty"` // p + // Example: 6NbkXwDWUhi-eR55Cgbf27FkQDDWIamOaDr0rj1q0f1fFEz1W5A_09YvG09Fiv1AO2-D8Rl8gS1Vkz2i0zCSqnyy8A025XOcRviOMK7nIxE4OH_PEsko8dtIrb3TmE2hUXvCkmzw9EsTF1LQBOGC6iusLTXepIC1x9ukCKFZQvdgtEObQ5kzd9Nhq-cdqmSeMVLoxPLd1blviVT9Vm8-y12CtYpeJHOaIDtVPLlBhJiBoPKWg3vxSm4XxIliNOefqegIlsmTIa3MpS6WWlCK3yHhat0Q-rRxDxdyiVdG_wzJvp0Iw_2wms7pe-PgNPYvUWH9JphWP5K38YqEBiJFXQ P string `json:"p,omitempty"` // q + // Example: 0A1FmpOWR91_RAWpqreWSavNaZb9nXeKiBo0DQGBz32DbqKqQ8S4aBJmbRhJcctjCLjain-ivut477tAUMmzJwVJDDq2MZFwC9Q-4VYZmFU4HJityQuSzHYe64RjN-E_NQ02TWhG3QGW6roq6c57c99rrUsETwJJiwS8M5p15Miuz53DaOjv-uqqFAFfywN5WkxHbraBcjHtMiQuyQbQqkCFh-oanHkwYNeytsNhTu2mQmwR5DR2roZ2nPiFjC6nsdk-A7E3S3wMzYYFw7jvbWWoYWo9vB40_MY2Y0FYQSqcDzcBIcq_0tnnasf3VW4Fdx6m80RzOb2Fsnln7vKXAQ Q string `json:"q,omitempty"` // qi + // Example: GyM_p6JrXySiz1toFgKbWV-JdI3jQ4ypu9rbMWx3rQJBfmt0FoYzgUIZEVFEcOqwemRN81zoDAaa-Bk0KWNGDjJHZDdDmFhW3AN7lI-puxk_mHZGJ11rxyR8O55XLSe3SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU Qi string `json:"qi,omitempty"` // Use ("public key use") identifies the intended use of // the public key. The "use" parameter is employed to indicate whether // a public key is used for encrypting data or verifying the signature // on data. Values are commonly "sig" (signature) or "enc" (encryption). + // Example: sig // Required: true Use *string `json:"use"` // x + // Example: f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU X string `json:"x,omitempty"` // The "x5c" (X.509 certificate chain) parameter contains a chain of one @@ -97,6 +114,7 @@ type JSONWebKey struct { X5c []string `json:"x5c"` // y + // Example: x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0 Y string `json:"y,omitempty"` } @@ -162,6 +180,11 @@ func (m *JSONWebKey) validateUse(formats strfmt.Registry) error { return nil } +// ContextValidate validates this JSON web key based on context it is used +func (m *JSONWebKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *JSONWebKey) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_web_key_set.go b/internal/httpclient/models/json_web_key_set.go index 87649fa82c9..cd57ff03687 100644 --- a/internal/httpclient/models/json_web_key_set.go +++ b/internal/httpclient/models/json_web_key_set.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -45,7 +46,6 @@ func (m *JSONWebKeySet) Validate(formats strfmt.Registry) error { } func (m *JSONWebKeySet) validateKeys(formats strfmt.Registry) error { - if swag.IsZero(m.Keys) { // not required return nil } @@ -69,6 +69,38 @@ func (m *JSONWebKeySet) validateKeys(formats strfmt.Registry) error { return nil } +// ContextValidate validate this JSON web key set based on the context it is used +func (m *JSONWebKeySet) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateKeys(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *JSONWebKeySet) contextValidateKeys(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Keys); i++ { + + if m.Keys[i] != nil { + if err := m.Keys[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("keys" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *JSONWebKeySet) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_web_key_set_generator_request.go b/internal/httpclient/models/json_web_key_set_generator_request.go index 37144b9e72b..3cad47f11d8 100644 --- a/internal/httpclient/models/json_web_key_set_generator_request.go +++ b/internal/httpclient/models/json_web_key_set_generator_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -82,6 +84,11 @@ func (m *JSONWebKeySetGeneratorRequest) validateUse(formats strfmt.Registry) err return nil } +// ContextValidate validates this json web key set generator request based on context it is used +func (m *JSONWebKeySetGeneratorRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *JSONWebKeySetGeneratorRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/login_request.go b/internal/httpclient/models/login_request.go index 4cf1b2d991b..7148d4cfddc 100644 --- a/internal/httpclient/models/login_request.go +++ b/internal/httpclient/models/login_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -133,7 +135,6 @@ func (m *LoginRequest) validateClient(formats strfmt.Registry) error { } func (m *LoginRequest) validateOidcContext(formats strfmt.Registry) error { - if swag.IsZero(m.OidcContext) { // not required return nil } @@ -209,6 +210,84 @@ func (m *LoginRequest) validateSubject(formats strfmt.Registry) error { return nil } +// ContextValidate validate this login request based on the context it is used +func (m *LoginRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClient(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOidcContext(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedAccessTokenAudience(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedScope(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LoginRequest) contextValidateClient(ctx context.Context, formats strfmt.Registry) error { + + if m.Client != nil { + if err := m.Client.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("client") + } + return err + } + } + + return nil +} + +func (m *LoginRequest) contextValidateOidcContext(ctx context.Context, formats strfmt.Registry) error { + + if m.OidcContext != nil { + if err := m.OidcContext.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oidc_context") + } + return err + } + } + + return nil +} + +func (m *LoginRequest) contextValidateRequestedAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RequestedAccessTokenAudience.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requested_access_token_audience") + } + return err + } + + return nil +} + +func (m *LoginRequest) contextValidateRequestedScope(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RequestedScope.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requested_scope") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *LoginRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/logout_request.go b/internal/httpclient/models/logout_request.go index df025037502..7450df11727 100644 --- a/internal/httpclient/models/logout_request.go +++ b/internal/httpclient/models/logout_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -51,7 +53,6 @@ func (m *LogoutRequest) Validate(formats strfmt.Registry) error { } func (m *LogoutRequest) validateClient(formats strfmt.Registry) error { - if swag.IsZero(m.Client) { // not required return nil } @@ -68,6 +69,34 @@ func (m *LogoutRequest) validateClient(formats strfmt.Registry) error { return nil } +// ContextValidate validate this logout request based on the context it is used +func (m *LogoutRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClient(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LogoutRequest) contextValidateClient(ctx context.Context, formats strfmt.Registry) error { + + if m.Client != nil { + if err := m.Client.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("client") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *LogoutRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/null_time.go b/internal/httpclient/models/null_time.go index 8e2e60607ff..46130d04b0b 100644 --- a/internal/httpclient/models/null_time.go +++ b/internal/httpclient/models/null_time.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -41,6 +43,11 @@ func (m NullTime) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this null time based on context it is used +func (m NullTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *NullTime) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/o_auth2_client.go b/internal/httpclient/models/o_auth2_client.go index 0324fb28bef..f625d8421ec 100644 --- a/internal/httpclient/models/o_auth2_client.go +++ b/internal/httpclient/models/o_auth2_client.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -213,7 +215,6 @@ func (m *OAuth2Client) Validate(formats strfmt.Registry) error { } func (m *OAuth2Client) validateAllowedCorsOrigins(formats strfmt.Registry) error { - if swag.IsZero(m.AllowedCorsOrigins) { // not required return nil } @@ -229,7 +230,6 @@ func (m *OAuth2Client) validateAllowedCorsOrigins(formats strfmt.Registry) error } func (m *OAuth2Client) validateAudience(formats strfmt.Registry) error { - if swag.IsZero(m.Audience) { // not required return nil } @@ -245,7 +245,6 @@ func (m *OAuth2Client) validateAudience(formats strfmt.Registry) error { } func (m *OAuth2Client) validateContacts(formats strfmt.Registry) error { - if swag.IsZero(m.Contacts) { // not required return nil } @@ -261,7 +260,6 @@ func (m *OAuth2Client) validateContacts(formats strfmt.Registry) error { } func (m *OAuth2Client) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -274,7 +272,6 @@ func (m *OAuth2Client) validateCreatedAt(formats strfmt.Registry) error { } func (m *OAuth2Client) validateGrantTypes(formats strfmt.Registry) error { - if swag.IsZero(m.GrantTypes) { // not required return nil } @@ -290,7 +287,6 @@ func (m *OAuth2Client) validateGrantTypes(formats strfmt.Registry) error { } func (m *OAuth2Client) validatePostLogoutRedirectUris(formats strfmt.Registry) error { - if swag.IsZero(m.PostLogoutRedirectUris) { // not required return nil } @@ -306,7 +302,6 @@ func (m *OAuth2Client) validatePostLogoutRedirectUris(formats strfmt.Registry) e } func (m *OAuth2Client) validateRedirectUris(formats strfmt.Registry) error { - if swag.IsZero(m.RedirectUris) { // not required return nil } @@ -322,7 +317,6 @@ func (m *OAuth2Client) validateRedirectUris(formats strfmt.Registry) error { } func (m *OAuth2Client) validateRequestUris(formats strfmt.Registry) error { - if swag.IsZero(m.RequestUris) { // not required return nil } @@ -338,7 +332,6 @@ func (m *OAuth2Client) validateRequestUris(formats strfmt.Registry) error { } func (m *OAuth2Client) validateResponseTypes(formats strfmt.Registry) error { - if swag.IsZero(m.ResponseTypes) { // not required return nil } @@ -354,12 +347,11 @@ func (m *OAuth2Client) validateResponseTypes(formats strfmt.Registry) error { } func (m *OAuth2Client) validateScope(formats strfmt.Registry) error { - if swag.IsZero(m.Scope) { // not required return nil } - if err := validate.Pattern("scope", "body", string(m.Scope), `([a-zA-Z0-9\.\*]+\s?)+`); err != nil { + if err := validate.Pattern("scope", "body", m.Scope, `([a-zA-Z0-9\.\*]+\s?)+`); err != nil { return err } @@ -367,7 +359,6 @@ func (m *OAuth2Client) validateScope(formats strfmt.Registry) error { } func (m *OAuth2Client) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -379,6 +370,144 @@ func (m *OAuth2Client) validateUpdatedAt(formats strfmt.Registry) error { return nil } +// ContextValidate validate this o auth2 client based on the context it is used +func (m *OAuth2Client) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAllowedCorsOrigins(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAudience(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContacts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrantTypes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePostLogoutRedirectUris(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRedirectUris(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestUris(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResponseTypes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OAuth2Client) contextValidateAllowedCorsOrigins(ctx context.Context, formats strfmt.Registry) error { + + if err := m.AllowedCorsOrigins.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("allowed_cors_origins") + } + return err + } + + return nil +} + +func (m *OAuth2Client) contextValidateAudience(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Audience.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("audience") + } + return err + } + + return nil +} + +func (m *OAuth2Client) contextValidateContacts(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Contacts.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contacts") + } + return err + } + + return nil +} + +func (m *OAuth2Client) contextValidateGrantTypes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.GrantTypes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grant_types") + } + return err + } + + return nil +} + +func (m *OAuth2Client) contextValidatePostLogoutRedirectUris(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PostLogoutRedirectUris.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("post_logout_redirect_uris") + } + return err + } + + return nil +} + +func (m *OAuth2Client) contextValidateRedirectUris(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RedirectUris.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("redirect_uris") + } + return err + } + + return nil +} + +func (m *OAuth2Client) contextValidateRequestUris(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RequestUris.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("request_uris") + } + return err + } + + return nil +} + +func (m *OAuth2Client) contextValidateResponseTypes(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ResponseTypes.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("response_types") + } + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *OAuth2Client) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/o_auth2_token_introspection.go b/internal/httpclient/models/o_auth2_token_introspection.go index fb97d72d935..a881a0d3ed2 100644 --- a/internal/httpclient/models/o_auth2_token_introspection.go +++ b/internal/httpclient/models/o_auth2_token_introspection.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -105,6 +107,11 @@ func (m *OAuth2TokenIntrospection) validateActive(formats strfmt.Registry) error return nil } +// ContextValidate validates this o auth2 token introspection based on context it is used +func (m *OAuth2TokenIntrospection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *OAuth2TokenIntrospection) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/oauth2_token_response.go b/internal/httpclient/models/oauth2_token_response.go index 4aec720a00f..542885008fe 100644 --- a/internal/httpclient/models/oauth2_token_response.go +++ b/internal/httpclient/models/oauth2_token_response.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -39,6 +41,11 @@ func (m *Oauth2TokenResponse) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this oauth2 token response based on context it is used +func (m *Oauth2TokenResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Oauth2TokenResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/open_id_connect_context.go b/internal/httpclient/models/open_id_connect_context.go index cbfdd337e40..398840441e0 100644 --- a/internal/httpclient/models/open_id_connect_context.go +++ b/internal/httpclient/models/open_id_connect_context.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -59,6 +61,11 @@ func (m *OpenIDConnectContext) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this open ID connect context based on context it is used +func (m *OpenIDConnectContext) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *OpenIDConnectContext) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/patch_document.go b/internal/httpclient/models/patch_document.go index fb3ea3652ef..0f8b9cac0db 100644 --- a/internal/httpclient/models/patch_document.go +++ b/internal/httpclient/models/patch_document.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -21,10 +23,12 @@ type PatchDocument struct { From string `json:"from,omitempty"` // The operation to be performed + // Example: \"replace\ // Required: true Op *string `json:"op"` // A JSON-pointer + // Example: \"/name\ // Required: true Path *string `json:"path"` @@ -68,6 +72,11 @@ func (m *PatchDocument) validatePath(formats strfmt.Registry) error { return nil } +// ContextValidate validates this patch document based on context it is used +func (m *PatchDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PatchDocument) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/patch_request.go b/internal/httpclient/models/patch_request.go index df227f4b73e..e974c6748e9 100644 --- a/internal/httpclient/models/patch_request.go +++ b/internal/httpclient/models/patch_request.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -43,3 +44,26 @@ func (m PatchRequest) Validate(formats strfmt.Registry) error { } return nil } + +// ContextValidate validate this patch request based on the context it is used +func (m PatchRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/models/plugin_config.go b/internal/httpclient/models/plugin_config.go index caaeea8e7d6..d062713f842 100644 --- a/internal/httpclient/models/plugin_config.go +++ b/internal/httpclient/models/plugin_config.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -328,7 +329,6 @@ func (m *PluginConfig) validatePropagatedMount(formats strfmt.Registry) error { } func (m *PluginConfig) validateUser(formats strfmt.Registry) error { - if swag.IsZero(m.User) { // not required return nil } @@ -355,7 +355,6 @@ func (m *PluginConfig) validateWorkDir(formats strfmt.Registry) error { } func (m *PluginConfig) validateRootfs(formats strfmt.Registry) error { - if swag.IsZero(m.Rootfs) { // not required return nil } @@ -372,6 +371,168 @@ func (m *PluginConfig) validateRootfs(formats strfmt.Registry) error { return nil } +// ContextValidate validate this plugin config based on the context it is used +func (m *PluginConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateArgs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEnv(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInterface(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinux(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMounts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNetwork(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUser(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRootfs(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PluginConfig) contextValidateArgs(ctx context.Context, formats strfmt.Registry) error { + + if m.Args != nil { + if err := m.Args.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Args") + } + return err + } + } + + return nil +} + +func (m *PluginConfig) contextValidateEnv(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Env); i++ { + + if m.Env[i] != nil { + if err := m.Env[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Env" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PluginConfig) contextValidateInterface(ctx context.Context, formats strfmt.Registry) error { + + if m.Interface != nil { + if err := m.Interface.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Interface") + } + return err + } + } + + return nil +} + +func (m *PluginConfig) contextValidateLinux(ctx context.Context, formats strfmt.Registry) error { + + if m.Linux != nil { + if err := m.Linux.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Linux") + } + return err + } + } + + return nil +} + +func (m *PluginConfig) contextValidateMounts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Mounts); i++ { + + if m.Mounts[i] != nil { + if err := m.Mounts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Mounts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PluginConfig) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error { + + if m.Network != nil { + if err := m.Network.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Network") + } + return err + } + } + + return nil +} + +func (m *PluginConfig) contextValidateUser(ctx context.Context, formats strfmt.Registry) error { + + if m.User != nil { + if err := m.User.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("User") + } + return err + } + } + + return nil +} + +func (m *PluginConfig) contextValidateRootfs(ctx context.Context, formats strfmt.Registry) error { + + if m.Rootfs != nil { + if err := m.Rootfs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rootfs") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PluginConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_args.go b/internal/httpclient/models/plugin_config_args.go index 053450e0ae9..15a65d6994a 100644 --- a/internal/httpclient/models/plugin_config_args.go +++ b/internal/httpclient/models/plugin_config_args.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -96,6 +98,11 @@ func (m *PluginConfigArgs) validateValue(formats strfmt.Registry) error { return nil } +// ContextValidate validates this plugin config args based on context it is used +func (m *PluginConfigArgs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PluginConfigArgs) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_interface.go b/internal/httpclient/models/plugin_config_interface.go index ccf8fc422dc..3e77cc86694 100644 --- a/internal/httpclient/models/plugin_config_interface.go +++ b/internal/httpclient/models/plugin_config_interface.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -19,6 +20,9 @@ import ( // swagger:model PluginConfigInterface type PluginConfigInterface struct { + // Protocol to use for clients connecting to the plugin. + ProtocolScheme string `json:"ProtocolScheme,omitempty"` + // socket // Required: true Socket *string `json:"Socket"` @@ -80,6 +84,38 @@ func (m *PluginConfigInterface) validateTypes(formats strfmt.Registry) error { return nil } +// ContextValidate validate this plugin config interface based on the context it is used +func (m *PluginConfigInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTypes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PluginConfigInterface) contextValidateTypes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Types); i++ { + + if m.Types[i] != nil { + if err := m.Types[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Types" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PluginConfigInterface) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_linux_swagger.go b/internal/httpclient/models/plugin_config_linux_swagger.go index 5671eb4d28a..046ba2ab691 100644 --- a/internal/httpclient/models/plugin_config_linux_swagger.go +++ b/internal/httpclient/models/plugin_config_linux_swagger.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -97,6 +98,38 @@ func (m *PluginConfigLinux) validateDevices(formats strfmt.Registry) error { return nil } +// ContextValidate validate this plugin config linux based on the context it is used +func (m *PluginConfigLinux) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDevices(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PluginConfigLinux) contextValidateDevices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Devices); i++ { + + if m.Devices[i] != nil { + if err := m.Devices[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Devices" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PluginConfigLinux) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_network.go b/internal/httpclient/models/plugin_config_network.go index 5649fd30a9b..89fb2c56807 100644 --- a/internal/httpclient/models/plugin_config_network.go +++ b/internal/httpclient/models/plugin_config_network.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -45,6 +47,11 @@ func (m *PluginConfigNetwork) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this plugin config network based on context it is used +func (m *PluginConfigNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PluginConfigNetwork) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_rootfs.go b/internal/httpclient/models/plugin_config_rootfs.go index 4497e49a3fe..64d545ac12b 100644 --- a/internal/httpclient/models/plugin_config_rootfs.go +++ b/internal/httpclient/models/plugin_config_rootfs.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -27,6 +29,11 @@ func (m *PluginConfigRootfs) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this plugin config rootfs based on context it is used +func (m *PluginConfigRootfs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PluginConfigRootfs) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_user.go b/internal/httpclient/models/plugin_config_user.go index 73574d68ff6..610727721e9 100644 --- a/internal/httpclient/models/plugin_config_user.go +++ b/internal/httpclient/models/plugin_config_user.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -27,6 +29,11 @@ func (m *PluginConfigUser) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this plugin config user based on context it is used +func (m *PluginConfigUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PluginConfigUser) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_device.go b/internal/httpclient/models/plugin_device.go index 7a3de422abc..8818e2dd71a 100644 --- a/internal/httpclient/models/plugin_device.go +++ b/internal/httpclient/models/plugin_device.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -96,6 +98,11 @@ func (m *PluginDevice) validateSettable(formats strfmt.Registry) error { return nil } +// ContextValidate validates this plugin device based on context it is used +func (m *PluginDevice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PluginDevice) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_env.go b/internal/httpclient/models/plugin_env.go index 6ed6644db68..00c2bcc6d69 100644 --- a/internal/httpclient/models/plugin_env.go +++ b/internal/httpclient/models/plugin_env.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -96,6 +98,11 @@ func (m *PluginEnv) validateValue(formats strfmt.Registry) error { return nil } +// ContextValidate validates this plugin env based on context it is used +func (m *PluginEnv) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PluginEnv) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_interface_type.go b/internal/httpclient/models/plugin_interface_type.go index d66549040eb..cb3185daba1 100644 --- a/internal/httpclient/models/plugin_interface_type.go +++ b/internal/httpclient/models/plugin_interface_type.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -79,6 +81,11 @@ func (m *PluginInterfaceType) validateVersion(formats strfmt.Registry) error { return nil } +// ContextValidate validates this plugin interface type based on context it is used +func (m *PluginInterfaceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PluginInterfaceType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_mount.go b/internal/httpclient/models/plugin_mount.go index 41eadd58191..be79d1e16bd 100644 --- a/internal/httpclient/models/plugin_mount.go +++ b/internal/httpclient/models/plugin_mount.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -147,6 +149,11 @@ func (m *PluginMount) validateType(formats strfmt.Registry) error { return nil } +// ContextValidate validates this plugin mount based on context it is used +func (m *PluginMount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *PluginMount) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_settings.go b/internal/httpclient/models/plugin_settings.go index 4e7d4ba9748..5da66acb905 100644 --- a/internal/httpclient/models/plugin_settings.go +++ b/internal/httpclient/models/plugin_settings.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -130,6 +131,60 @@ func (m *PluginSettings) validateMounts(formats strfmt.Registry) error { return nil } +// ContextValidate validate this plugin settings based on the context it is used +func (m *PluginSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDevices(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMounts(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PluginSettings) contextValidateDevices(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Devices); i++ { + + if m.Devices[i] != nil { + if err := m.Devices[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Devices" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PluginSettings) contextValidateMounts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Mounts); i++ { + + if m.Mounts[i] != nil { + if err := m.Mounts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Mounts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PluginSettings) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/previous_consent_session.go b/internal/httpclient/models/previous_consent_session.go index b0b0616f356..28e68bad493 100644 --- a/internal/httpclient/models/previous_consent_session.go +++ b/internal/httpclient/models/previous_consent_session.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -73,7 +75,6 @@ func (m *PreviousConsentSession) Validate(formats strfmt.Registry) error { } func (m *PreviousConsentSession) validateConsentRequest(formats strfmt.Registry) error { - if swag.IsZero(m.ConsentRequest) { // not required return nil } @@ -91,7 +92,6 @@ func (m *PreviousConsentSession) validateConsentRequest(formats strfmt.Registry) } func (m *PreviousConsentSession) validateGrantAccessTokenAudience(formats strfmt.Registry) error { - if swag.IsZero(m.GrantAccessTokenAudience) { // not required return nil } @@ -107,7 +107,6 @@ func (m *PreviousConsentSession) validateGrantAccessTokenAudience(formats strfmt } func (m *PreviousConsentSession) validateGrantScope(formats strfmt.Registry) error { - if swag.IsZero(m.GrantScope) { // not required return nil } @@ -123,7 +122,6 @@ func (m *PreviousConsentSession) validateGrantScope(formats strfmt.Registry) err } func (m *PreviousConsentSession) validateHandledAt(formats strfmt.Registry) error { - if swag.IsZero(m.HandledAt) { // not required return nil } @@ -139,7 +137,6 @@ func (m *PreviousConsentSession) validateHandledAt(formats strfmt.Registry) erro } func (m *PreviousConsentSession) validateSession(formats strfmt.Registry) error { - if swag.IsZero(m.Session) { // not required return nil } @@ -156,6 +153,100 @@ func (m *PreviousConsentSession) validateSession(formats strfmt.Registry) error return nil } +// ContextValidate validate this previous consent session based on the context it is used +func (m *PreviousConsentSession) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateConsentRequest(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrantAccessTokenAudience(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrantScope(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHandledAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSession(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PreviousConsentSession) contextValidateConsentRequest(ctx context.Context, formats strfmt.Registry) error { + + if m.ConsentRequest != nil { + if err := m.ConsentRequest.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("consent_request") + } + return err + } + } + + return nil +} + +func (m *PreviousConsentSession) contextValidateGrantAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { + + if err := m.GrantAccessTokenAudience.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grant_access_token_audience") + } + return err + } + + return nil +} + +func (m *PreviousConsentSession) contextValidateGrantScope(ctx context.Context, formats strfmt.Registry) error { + + if err := m.GrantScope.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grant_scope") + } + return err + } + + return nil +} + +func (m *PreviousConsentSession) contextValidateHandledAt(ctx context.Context, formats strfmt.Registry) error { + + if err := m.HandledAt.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("handled_at") + } + return err + } + + return nil +} + +func (m *PreviousConsentSession) contextValidateSession(ctx context.Context, formats strfmt.Registry) error { + + if m.Session != nil { + if err := m.Session.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("session") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PreviousConsentSession) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/reject_request.go b/internal/httpclient/models/reject_request.go index 37c02f35926..42cf41b5228 100644 --- a/internal/httpclient/models/reject_request.go +++ b/internal/httpclient/models/reject_request.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -41,6 +43,11 @@ func (m *RejectRequest) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this reject request based on context it is used +func (m *RejectRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *RejectRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/request_was_handled_response.go b/internal/httpclient/models/request_was_handled_response.go index 1a224f2b3e8..5430cd2ef03 100644 --- a/internal/httpclient/models/request_was_handled_response.go +++ b/internal/httpclient/models/request_was_handled_response.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -45,6 +47,11 @@ func (m *RequestWasHandledResponse) validateRedirectTo(formats strfmt.Registry) return nil } +// ContextValidate validates this request was handled response based on context it is used +func (m *RequestWasHandledResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *RequestWasHandledResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/string_slice_pipe_delimiter.go b/internal/httpclient/models/string_slice_pipe_delimiter.go index c7bc80e83c0..76d7a757791 100644 --- a/internal/httpclient/models/string_slice_pipe_delimiter.go +++ b/internal/httpclient/models/string_slice_pipe_delimiter.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -18,3 +20,8 @@ type StringSlicePipeDelimiter []string func (m StringSlicePipeDelimiter) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this string slice pipe delimiter based on context it is used +func (m StringSlicePipeDelimiter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/internal/httpclient/models/userinfo_response.go b/internal/httpclient/models/userinfo_response.go index 9b5fb8685fb..a78e76c3204 100644 --- a/internal/httpclient/models/userinfo_response.go +++ b/internal/httpclient/models/userinfo_response.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -78,6 +80,11 @@ func (m *UserinfoResponse) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this userinfo response based on context it is used +func (m *UserinfoResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *UserinfoResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/version.go b/internal/httpclient/models/version.go index 8e687bcb20d..2a92642e537 100644 --- a/internal/httpclient/models/version.go +++ b/internal/httpclient/models/version.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -24,6 +26,11 @@ func (m *Version) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this version based on context it is used +func (m *Version) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Version) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/volume.go b/internal/httpclient/models/volume.go index f278b8ac30b..a27d9734b32 100644 --- a/internal/httpclient/models/volume.go +++ b/internal/httpclient/models/volume.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -40,7 +42,8 @@ type Volume struct { // Required: true Options map[string]string `json:"Options"` - // The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. + // The level at which the volume exists. Either `global` for cluster-wide, + // or `local` for machine level. // Required: true Scope *string `json:"Scope"` @@ -105,6 +108,10 @@ func (m *Volume) validateDriver(formats strfmt.Registry) error { func (m *Volume) validateLabels(formats strfmt.Registry) error { + if err := validate.Required("Labels", "body", m.Labels); err != nil { + return err + } + return nil } @@ -128,6 +135,10 @@ func (m *Volume) validateName(formats strfmt.Registry) error { func (m *Volume) validateOptions(formats strfmt.Registry) error { + if err := validate.Required("Options", "body", m.Options); err != nil { + return err + } + return nil } @@ -141,7 +152,6 @@ func (m *Volume) validateScope(formats strfmt.Registry) error { } func (m *Volume) validateUsageData(formats strfmt.Registry) error { - if swag.IsZero(m.UsageData) { // not required return nil } @@ -158,6 +168,34 @@ func (m *Volume) validateUsageData(formats strfmt.Registry) error { return nil } +// ContextValidate validate this volume based on the context it is used +func (m *Volume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUsageData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Volume) contextValidateUsageData(ctx context.Context, formats strfmt.Registry) error { + + if m.UsageData != nil { + if err := m.UsageData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("UsageData") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *Volume) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/volume_usage_data.go b/internal/httpclient/models/volume_usage_data.go index 886190c490b..bfae17367cf 100644 --- a/internal/httpclient/models/volume_usage_data.go +++ b/internal/httpclient/models/volume_usage_data.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -67,6 +69,11 @@ func (m *VolumeUsageData) validateSize(formats strfmt.Registry) error { return nil } +// ContextValidate validates this volume usage data based on context it is used +func (m *VolumeUsageData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *VolumeUsageData) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/well_known.go b/internal/httpclient/models/well_known.go index 7641cc66a44..d06e5d74034 100644 --- a/internal/httpclient/models/well_known.go +++ b/internal/httpclient/models/well_known.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -21,6 +23,7 @@ import ( type WellKnown struct { // URL of the OP's OAuth 2.0 Authorization Endpoint. + // Example: https://playground.ory.sh/ory-hydra/public/oauth2/auth // Required: true AuthorizationEndpoint *string `json:"authorization_endpoint"` @@ -64,6 +67,7 @@ type WellKnown struct { // URL using the https scheme with no query or fragment component that the OP asserts as its IssuerURL Identifier. // If IssuerURL discovery is supported , this value MUST be identical to the issuer value returned // by WebFinger. This also MUST be identical to the iss Claim value in ID Tokens issued from this IssuerURL. + // Example: https://playground.ory.sh/ory-hydra/public/ // Required: true Issuer *string `json:"issuer"` @@ -74,10 +78,12 @@ type WellKnown struct { // Although some algorithms allow the same key to be used for both signatures and encryption, doing so is // NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of // keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate. + // Example: https://playground.ory.sh/ory-hydra/public/.well-known/jwks.json // Required: true JwksURI *string `json:"jwks_uri"` // URL of the OP's Dynamic Client Registration Endpoint. + // Example: https://playground.ory.sh/ory-hydra/admin/client RegistrationEndpoint string `json:"registration_endpoint,omitempty"` // JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for Request Objects, @@ -117,6 +123,7 @@ type WellKnown struct { SubjectTypesSupported []string `json:"subject_types_supported"` // URL of the OP's OAuth 2.0 Token Endpoint + // Example: https://playground.ory.sh/ory-hydra/public/oauth2/token // Required: true TokenEndpoint *string `json:"token_endpoint"` @@ -232,6 +239,11 @@ func (m *WellKnown) validateTokenEndpoint(formats strfmt.Registry) error { return nil } +// ContextValidate validates this well known based on context it is used +func (m *WellKnown) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *WellKnown) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/spec/api.json b/spec/api.json index 3c9b484f6df..919fa446b92 100755 --- a/spec/api.json +++ b/spec/api.json @@ -2305,6 +2305,10 @@ "Types" ], "properties": { + "ProtocolScheme": { + "description": "Protocol to use for clients connecting to the plugin.", + "type": "string" + }, "Socket": { "description": "socket", "type": "string" @@ -2647,7 +2651,7 @@ } }, "Scope": { - "description": "The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level.", + "description": "The level at which the volume exists. Either `global` for cluster-wide,\nor `local` for machine level.", "type": "string" }, "Status": { From b6ff5cba24e0b30045f7262edfd88f925482eb64 Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Mon, 19 Jul 2021 10:51:08 +0200 Subject: [PATCH 23/41] Fix vulnerability https://ossindex.sonatype.org/vulnerability/1a11ab24-7bd1-4056-8fb0-450a7e4904b6\?component-type\=golang\&component-name\=github.com%2Fgobuffalo%2Fpackr\&utm_source\=nancy-client\&utm_medium\=integration\&utm_content\=1.0.22 --- go.mod | 2 ++ go.sum | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/go.mod b/go.mod index 885b2bddad8..be433c0916f 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,8 @@ replace github.com/dgrijalva/jwt-go => github.com/form3tech-oss/jwt-go v3.2.1+in replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 +replace github.com/gobuffalo/packr => github.com/gobuffalo/packr v1.30.1 + replace github.com/oleiade/reflections => github.com/oleiade/reflections v1.0.1 require ( diff --git a/go.sum b/go.sum index e2ae256948d..ed631d432a2 100644 --- a/go.sum +++ b/go.sum @@ -526,6 +526,8 @@ github.com/gobuffalo/packr v1.20.0/go.mod h1:JDytk1t2gP+my1ig7iI4NcVaXr886+N0ecU github.com/gobuffalo/packr v1.21.0/go.mod h1:H00jGfj1qFKxscFJSw8wcL4hpQtPe1PfU2wa6sg/SR0= github.com/gobuffalo/packr v1.22.0 h1:/YVd/GRGsu0QuoCJtlcWSVllobs4q3Xvx3nqxTvPyN0= github.com/gobuffalo/packr v1.22.0/go.mod h1:Qr3Wtxr3+HuQEwWqlLnNW4t1oTvK+7Gc/Rnoi/lDFvA= +github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg= +github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk= github.com/gobuffalo/packr/v2 v2.0.0-rc.8/go.mod h1:y60QCdzwuMwO2R49fdQhsjCPv7tLQFR0ayzxxla9zes= github.com/gobuffalo/packr/v2 v2.0.0-rc.9/go.mod h1:fQqADRfZpEsgkc7c/K7aMew3n4aF1Kji7+lIZeR98Fc= github.com/gobuffalo/packr/v2 v2.0.0-rc.10/go.mod h1:4CWWn4I5T3v4c1OsJ55HbHlUEKNWMITG5iIkdr4Px4w= @@ -537,6 +539,7 @@ github.com/gobuffalo/packr/v2 v2.0.0-rc.15/go.mod h1:IMe7H2nJvcKXSF90y4X1rjYIRlN github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/packr/v2 v2.4.0/go.mod h1:ra341gygw9/61nSjAbfwcwh8IrYL4WmR4IsPkPBhQiY= +github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw= github.com/gobuffalo/packr/v2 v2.5.2/go.mod h1:sgEE1xNZ6G0FNN5xn9pevVu4nywaxHvgup67xisti08= github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= github.com/gobuffalo/packr/v2 v2.8.0 h1:IULGd15bQL59ijXLxEvA5wlMxsmx/ZkQv9T282zNVIY= @@ -1753,6 +1756,7 @@ golang.org/x/tools v0.0.0-20190613204242-ed0dc450797f/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624190245-7f2218787638/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= From 5b01e585a5daeef921508e2ac059cd42bea5bb07 Mon Sep 17 00:00:00 2001 From: "javier.viera@mindcurv.com" Date: Mon, 19 Jul 2021 12:33:41 +0200 Subject: [PATCH 24/41] Add coverage for client handler --- client/handler_test.go | 142 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) diff --git a/client/handler_test.go b/client/handler_test.go index 21cd7c41e54..deddbadaf76 100644 --- a/client/handler_test.go +++ b/client/handler_test.go @@ -21,7 +21,9 @@ package client_test import ( + "bytes" "net/http" + "net/http/httptest" "testing" "github.com/stretchr/testify/require" @@ -63,3 +65,143 @@ func TestValidateDynClientRegistrationAuthorizationBadBasicAuthKo(t *testing.T) err := h.ValidateDynClientRegistrationAuthorization(hr, c) require.EqualValues(t, "The request could not be authorized", err.Error()) } + +func TestCreateOk(t *testing.T) { + u := "https://www.something.com" + var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) + req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) + if err != nil { + panic(err) + } + rr := httptest.NewRecorder() + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + h.Create(rr, req, nil) + require.EqualValues(t, http.StatusCreated, rr.Result().StatusCode) +} + +func TestCreateDynamicRegistrationOk(t *testing.T) { + u := "https://www.something.com" + var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) + req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) + if err != nil { + panic(err) + } + rr := httptest.NewRecorder() + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + h.CreateDynamicRegistration(rr, req, nil) + require.EqualValues(t, http.StatusCreated, rr.Result().StatusCode) +} + +func TestUpdateKo(t *testing.T) { + u := "https://www.something.com" + var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) + req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) + if err != nil { + panic(err) + } + rr := httptest.NewRecorder() + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + h.Update(rr, req, nil) + require.EqualValues(t, http.StatusNotFound, rr.Result().StatusCode) +} + +func TestPatchKo(t *testing.T) { + u := "https://www.something.com" + var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) + req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) + if err != nil { + panic(err) + } + rr := httptest.NewRecorder() + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + h.Patch(rr, req, nil) + require.EqualValues(t, http.StatusNotFound, rr.Result().StatusCode) +} + +func TestUpdateDynamicRegistrationKo(t *testing.T) { + u := "https://www.something.com" + var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) + req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) + if err != nil { + panic(err) + } + rr := httptest.NewRecorder() + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + h.UpdateDynamicRegistration(rr, req, nil) + require.EqualValues(t, http.StatusUnauthorized, rr.Result().StatusCode) +} + +func TestListOk(t *testing.T) { + u := "https://www.something.com" + var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) + req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) + if err != nil { + panic(err) + } + rr := httptest.NewRecorder() + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + h.List(rr, req, nil) + require.EqualValues(t, http.StatusOK, rr.Result().StatusCode) +} + +func TestGetKo(t *testing.T) { + u := "https://www.something.com" + var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) + req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) + if err != nil { + panic(err) + } + rr := httptest.NewRecorder() + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + h.Get(rr, req, nil) + require.EqualValues(t, http.StatusUnauthorized, rr.Result().StatusCode) +} + +func TestGetDynamicRegistrationKo(t *testing.T) { + u := "https://www.something.com" + var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) + req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) + if err != nil { + panic(err) + } + rr := httptest.NewRecorder() + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + h.GetDynamicRegistration(rr, req, nil) + require.EqualValues(t, http.StatusUnauthorized, rr.Result().StatusCode) +} + +func TestDeleteKo(t *testing.T) { + u := "https://www.something.com" + var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) + req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) + if err != nil { + panic(err) + } + rr := httptest.NewRecorder() + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + h.Delete(rr, req, nil) + require.EqualValues(t, http.StatusNotFound, rr.Result().StatusCode) +} + +func TestDeleteDynamicRegistrationKo(t *testing.T) { + u := "https://www.something.com" + var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) + req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) + if err != nil { + panic(err) + } + rr := httptest.NewRecorder() + reg := internal.NewMockedRegistry(t) + h := client.NewHandler(reg) + h.DeleteDynamicRegistration(rr, req, nil) + require.EqualValues(t, http.StatusUnauthorized, rr.Result().StatusCode) +} From 42ed3d5c1d9c5f1f761cdcaafeebddde113cf56e Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Wed, 29 Dec 2021 16:49:46 +0200 Subject: [PATCH 25/41] fix: reuse auth from fosite --- client/handler.go | 112 ++++++++++++++++---------------------------- client/registry.go | 1 + client/validator.go | 2 +- go.mod | 1 - x/authenticator.go | 16 +++++++ 5 files changed, 58 insertions(+), 74 deletions(-) create mode 100644 x/authenticator.go diff --git a/client/handler.go b/client/handler.go index e9cf153ae06..82b5c7ecfbd 100644 --- a/client/handler.go +++ b/client/handler.go @@ -22,11 +22,9 @@ package client import ( "context" - "encoding/base64" "encoding/json" "io" "net/http" - "strings" "time" "github.com/ory/x/errorsx" @@ -105,11 +103,15 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Pa h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &c) } -// swagger:route POST /connect/register public createOAuth2ClientPublic +// swagger:route POST /connect/register public selfServiceCreateOAuth2Client // -// Create an OAuth 2.0 Client +// Register an OAuth 2.0 Client using OpenID Dynamic Client Registration +// +// This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is facing the public internet. This +// feature needs to be enabled in the configuration. // -// Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe. +// Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be +// generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe. // // OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. // @@ -162,7 +164,6 @@ func (h *Handler) create(w http.ResponseWriter, r *http.Request, f func(*Client) if err := h.r.ClientManager().CreateClient(r.Context(), &c); err != nil { return nil, err } - c.Secret = "" if !c.IsPublic() { c.Secret = secret @@ -279,9 +280,12 @@ func (h *Handler) updateClient(ctx context.Context, c *Client) error { return nil } -// swagger:route PUT/connect/register public updateOAuth2ClientPublic +// swagger:route PUT/connect/register public selfServiceUpdateOAuth2Client // -// Update an OAuth 2.0 Client +// Register an OAuth 2.0 Client using OpenID Dynamic Client Registration +// +// This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is facing the public internet and can be +// used in self-service. This feature needs to be enabled in the configuration. // // Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. // @@ -299,8 +303,15 @@ func (h *Handler) updateClient(ctx context.Context, c *Client) error { // 200: oAuth2Client // 500: genericError func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - var c Client + client, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.Form) + if err != nil { + h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrUnauthorized. + WithTrace(err). + WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials").WithDebug(err.Error()))) + return + } + var c Client if err := json.NewDecoder(r.Body).Decode(&c); err != nil { h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) return @@ -311,12 +322,7 @@ func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Reque secret = c.Secret } - c.OutfacingID = r.URL.Query().Get("client_id") - if err := h.ValidateDynClientRegistrationAuthorization(r, c); err != nil { - h.r.Writer().WriteErrorCode(w, r, http.StatusUnauthorized, err) - return - } - + c.OutfacingID = client.GetID() if err := h.r.ClientValidator().ValidateDynamicRegistration(&c); err != nil { h.r.Writer().WriteError(w, r, err) return @@ -443,7 +449,7 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para h.r.Writer().Write(w, r, c) } -// swagger:route GET /connect/register public getOAuth2ClientPublic +// swagger:route GET /connect/register public selfServiceGetOAuth2Client // // Get an OAuth 2.0 Client. // @@ -465,17 +471,18 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para // 401: genericError // 500: genericError func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - var id = r.URL.Query().Get("client_id") - - c, err := h.r.ClientManager().GetConcreteClient(r.Context(), id) + client, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.Form) if err != nil { - err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") - h.r.Writer().WriteError(w, r, err) + h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrUnauthorized. + WithTrace(err). + WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials").WithDebug(err.Error()))) return } - if err := h.ValidateDynClientRegistrationAuthorization(r, *c); err != nil { - h.r.Writer().WriteErrorCode(w, r, http.StatusUnauthorized, err) + c, err := h.r.ClientManager().GetConcreteClient(r.Context(), client.GetID()) + if err != nil { + err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") + h.r.Writer().WriteError(w, r, err) return } @@ -506,7 +513,6 @@ func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, // 500: jsonError func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var id = ps.ByName("id") - if err := h.r.ClientManager().DeleteClient(r.Context(), id); err != nil { h.r.Writer().WriteError(w, r, err) return @@ -515,9 +521,12 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P w.WriteHeader(http.StatusNoContent) } -// swagger:route DELETE /connect/register public deleteOAuth2ClientPublic +// swagger:route DELETE /connect/register public selfServiceDeleteOAuth2Client // -// Deletes an OAuth 2.0 Client +// Deletes an OAuth 2.0 Client using OpenID Dynamic Client Registration +// +// This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is facing the public internet and can be +// used in self-service. This feature needs to be enabled in the configuration. // // Delete an existing OAuth 2.0 Client by its ID. // @@ -536,59 +545,18 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P // 404: genericError // 500: genericError func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - var id = r.URL.Query().Get("client_id") - - c, err := h.r.ClientManager().GetConcreteClient(r.Context(), id) + client, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.Form) if err != nil { - err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") - h.r.Writer().WriteError(w, r, err) - return - } - - if err := h.ValidateDynClientRegistrationAuthorization(r, *c); err != nil { - h.r.Writer().WriteErrorCode(w, r, http.StatusUnauthorized, err) + h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrUnauthorized. + WithTrace(err). + WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials").WithDebug(err.Error()))) return } - if err := h.r.ClientManager().DeleteClient(r.Context(), id); err != nil { + if err := h.r.ClientManager().DeleteClient(r.Context(), client.GetID()); err != nil { h.r.Writer().WriteError(w, r, err) return } w.WriteHeader(http.StatusNoContent) } - -func (h *Handler) ValidateDynClientRegistrationAuthorization(r *http.Request, c Client) error { - - basicAuth := getBasicAuth(r) - if basicAuth == "" { - return herodot.ErrUnauthorized.WithReason("Invalid authorization") - } - sDec, err := base64.StdEncoding.DecodeString(basicAuth) - if err != nil { - return herodot.ErrUnauthorized.WithReason("Invalid authorization") - } - split := strings.SplitN(string(sDec), ":", 2) - if len(split) != 2 { - return herodot.ErrUnauthorized.WithReason("Invalid authorization") - } - if c.OutfacingID != split[0] { - return herodot.ErrUnauthorized.WithReason("Invalid authorization") - } - _, err = h.r.ClientManager().Authenticate(r.Context(), split[0], []byte(split[1])) - if err != nil { - return herodot.ErrUnauthorized.WithReason("Invalid authorization") - } - return nil -} - -func getBasicAuth(req *http.Request) string { - auth := req.Header.Get("Authorization") - split := strings.SplitN(auth, " ", 2) - if len(split) != 2 || !strings.EqualFold(split[0], "Basic") { - // Nothing in Authorization header - return "" - } - - return split[1] -} diff --git a/client/registry.go b/client/registry.go index e362035047c..5ef7c1df1f1 100644 --- a/client/registry.go +++ b/client/registry.go @@ -16,4 +16,5 @@ type Registry interface { ClientManager() Manager ClientHasher() fosite.Hasher OpenIDJWTStrategy() jwk.JWTStrategy + x.ClientAuthenticatorProvider } diff --git a/client/validator.go b/client/validator.go index 73df5871ccd..0fb69294fb4 100644 --- a/client/validator.go +++ b/client/validator.go @@ -187,12 +187,12 @@ func (v *Validator) Validate(c *Client) error { } func (v *Validator) ValidateDynamicRegistration(c *Client) error { - if c.Metadata != nil { return errorsx.WithStack(ErrInvalidClientMetadata. WithHint(`metadata cannot be set for dynamic client registration'`), ) } + return v.Validate(c) } diff --git a/go.mod b/go.mod index 2cb4ae6519f..ab5bac2c678 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,6 @@ replace ( ) require ( - github.com/bradleyjkemp/cupaloy/v2 v2.6.0 github.com/cenkalti/backoff/v3 v3.0.0 github.com/evanphx/json-patch v4.9.0+incompatible github.com/go-bindata/go-bindata v3.1.2+incompatible diff --git a/x/authenticator.go b/x/authenticator.go new file mode 100644 index 00000000000..1c333fd702c --- /dev/null +++ b/x/authenticator.go @@ -0,0 +1,16 @@ +package x + +import ( + "context" + "github.com/ory/fosite" + "net/http" + "net/url" +) + +type ClientAuthenticatorProvider interface { + ClientAuthenticator() ClientAuthenticator +} + +type ClientAuthenticator interface { + AuthenticateClient(ctx context.Context, r *http.Request, form url.Values) (fosite.Client, error) +} From 77e0cb5e0053787084bcfa75da96da3bedb8de5c Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Fri, 31 Dec 2021 19:57:52 +0200 Subject: [PATCH 26/41] test: add tests and fixtures for client handler --- CONTRIBUTORS | 272 +++++++++++++ ...d=DELETE-with_a_different_client_auth.json | 7 + ...elfservice-method=DELETE-without_auth.json | 7 + ...-method=DELETE-without_incorrect_auth.json | 7 + ...thod=GET-with_a_different_client_auth.json | 7 + ...t=selfservice-method=GET-without_auth.json | 7 + ...ice-method=GET-without_incorrect_auth.json | 7 + ...thod=PUT-with_a_different_client_auth.json | 7 + ...t=selfservice-method=PUT-without_auth.json | 7 + ...ice-method=PUT-without_incorrect_auth.json | 7 + ...e_clients-case=0-description=standard.json | 25 ++ ...nts-case=1-description=metadata_fails.json | 4 + ...case=2-description=short_secret_fails.json | 4 + ...tching_client_existing-endpoint=admin.json | 27 ++ ...=selfservice-with_correct_client_auth.json | 26 ++ ...hich_does_not_exist-path=-clients-foo.json | 7 + ...-path=-connect-register?client_id=foo.json | 7 + client/doc.go | 24 +- client/handler.go | 178 ++++---- client/handler_test.go | 382 ++++++++++-------- driver/registry_base.go | 4 + x/authenticator.go | 3 +- 22 files changed, 753 insertions(+), 273 deletions(-) create mode 100644 CONTRIBUTORS create mode 100644 client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-with_a_different_client_auth.json create mode 100644 client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_auth.json create mode 100644 client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_incorrect_auth.json create mode 100644 client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-with_a_different_client_auth.json create mode 100644 client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json create mode 100644 client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json create mode 100644 client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-with_a_different_client_auth.json create mode 100644 client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json create mode 100644 client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json create mode 100644 client/.snapshots/TestHandler-common-case=create_clients-case=0-description=standard.json create mode 100644 client/.snapshots/TestHandler-common-case=create_clients-case=1-description=metadata_fails.json create mode 100644 client/.snapshots/TestHandler-common-case=create_clients-case=2-description=short_secret_fails.json create mode 100644 client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=admin.json create mode 100644 client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=selfservice-with_correct_client_auth.json create mode 100644 client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-clients-foo.json create mode 100644 client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-connect-register?client_id=foo.json diff --git a/CONTRIBUTORS b/CONTRIBUTORS new file mode 100644 index 00000000000..a28139fb362 --- /dev/null +++ b/CONTRIBUTORS @@ -0,0 +1,272 @@ +# contributors generated by `make contributors` + +115100 <115100@users.noreply.github.com> +Ackermann Yuriy +Aeneas +Aeneas +Aeneas +Aeneas Rekkas (arekkas) +Aeneas Rekkas +Ajanthan +Akbar Uddin Kashif +Alano Terblanche +Alexander Widerberg +Alexander Widerberg +Allan Simon +Amaan Iqbal +Amir Aslaminejad +Amir Aslaminejad +Andreas Litt +André Filipe +Ankit Singh +Ante Mihalj +Anton Samoylenko +Aritz Berasarte +Arkady Bagdasarov <56913719+arkady-bagdasarov@users.noreply.github.com> +Artem Yarmoliuk +Arthur Knoepflin +Atallah khedrane +BastianHofmann +Ben Scholzen +Benjamin Tanone +Bernat Mut <1116133+monwolf@users.noreply.github.com> +Bhargav SNV <44526455+Gituser143@users.noreply.github.com> +Brandon Philips +Brian <20056195+coopbri@users.noreply.github.com> +Brian Teller +Bruno Bigras +Bruno Heridet +Chris Mack +Christian Dreier +Christian Skovholm +Corey Burmeister +Dallan Quass +Damien Bravin +Daniel Jiménez +Daniel Schellhorn +Daniel Shuy +Daniel Sutton +Dave Kushner <1289314+dkushner@users.noreply.github.com> +David +David +David Lobe +David López +David Wilkins +DennisPattmann5012 <44261569+DennisPattmann5012@users.noreply.github.com> +Dexter Chua +Dibyajyoti Behera +Dimitrij Drus +Dimitrij Drus +Divyansh Bansal +Dmitry +Dmitry Dolbik +Edward Wilde +Eric Douglas +Euan Kemp +Felix Jung +Flavio Leggio +Flori <40140792+fl0lli@users.noreply.github.com> +Frank Felhoffer +Furkan +Gajewski Dmitriy +Genchi +George Bolo +Gilbert Gilb's +Gorka Lerchundi Osa +Grant Zvolsky +Grant Zvolský +Greg Woodcock +Grigory +Hans +Harsimran Singh Maan +Helmuth Bederna <25813283+IonFoXx@users.noreply.github.com> +Hendrik Heil +Igor Zibarev +Imran Ismail +Iñigo +Iñigo +Jacek Symonowicz +Jakub Błaszczyk +Jakub Błaszczyk +James Elliott +Jamie Stackhouse +Jan +Jan Beckmann +Jay Linski +JiaLiPassion +Jimmy Stridh +Joao Carlos +Joao Carlos +Joel Pickup +John +John Wu +Josh Giles +Joshua Obasaju <41480580+obasajujoshua31@users.noreply.github.com> +Julian Tescher +Justin Clift +Kevin Minehart +Kim Neunert +Kishan B +Kostya Lepa +Kunal Parikh +L7280153 +LemurP +Lennart Rosam +Louis Laureys +Luis Pedrosa <2365589+lpedrosa@users.noreply.github.com> +Lukasz Jagiello +Luke Stoward +MOZGIII +Marco Hutzsch <39520486+marcohutzsch1234@users.noreply.github.com> +Masoud Tahmasebi +Matheus Moraes +Matt Bonnell <64976795+mbonnell-wish@users.noreply.github.com> +Matt Bonnell +Matt Drollette +Matt Vinall +Matt Vinall +Matteo Suppo +Matthew Fawcett +Maurizio +Max Köhler +Maxime Song +Mitar +Mitar +Moritz Lang +Natalia +Nathan Mills +Neeraj +Nejcraft +Nestor +Nick Otter +Nick Ufer +NickUfer +Nikita Puzankov +Nikolay Stupak +NikolaySl +ORY Continuous Integration +ORY Continuous Integration +ORY Continuous Integration +Olivier Deckers +Olivier Tremblay +Oz Haven +Patrick Barker +Patrick Tescher +Patrik +Paul Harman +Petr Jediný +Philip Nicolcev <33558528+pnicolcev-tulipretail@users.noreply.github.com> +Philip Nicolcev +Pierre-David Bélanger +Prateek Malhotra +Quentin Perez +RNBack +Ricardo Iván Vieitez Parra <3857362+corrideat@users.noreply.github.com> +Rich Wareham +Richard Zana +RikiyaFujii +Rob Smith +Roman Lytvyn +Roman Minkin +Saad Tazi +SaintMalik <37118134+saintmalik@users.noreply.github.com> +Samuele Lilli +Sawada Shota +Sawada Shota +Shadaï ALI +Shane Starcher +Shankar Dhanasekaran +Shaurya Dhadwal +Shota SAWADA +Simon Lipp +Simon-Pierre Gingras <892367+spg@users.noreply.github.com> +Smotrov Dmitriy +Stepan Rakitin +Stephan Renatus +Steve Kaliski +Sufijen Bani +Sven Neuhaus +T Venu Madhav +The Gitter Badger +Thibault Doubliez +Thomas Aidan Curran +Thomas Aidan Curran +Thomas Recloux +Thomas Stewart +Thor Marius Henrichsen +TilmanTheile <50573074+TilmanTheile@users.noreply.github.com> +Tim Sazon +Vadim +Vincent +Vinci Xu <277040271@qq.com> +Vishesh Handa +Vitaly Migunov +Vladimir Kalugin +Wei Cheng +Wojciech Kuźmiński <45849042+woojtek@users.noreply.github.com> +Wyatt Anderson +Yannick Heinrich +Yorman ����’.͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇Ỏ̷͖͈̞̩͎̻̫̫̜͉̠̫͕̭̭̫ ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ +Yuki Hirasawa <48427044+hirasawayuki@users.noreply.github.com> +Zbigniew Mandziejewicz +abusaidm +aeneasr <3372410+aeneasr@users.noreply.github.com> +aeneasr +aeneasr +aeneasr +arapaho +arekkas +arekkas +arunas-ka +aspeteRakete +bfrisbie-brex <63267486+bfrisbie-brex@users.noreply.github.com> +catper <60221155+catper@users.noreply.github.com> +cherrymu +clausdenk +darron froese +debrutal +dharmendraImprowised <72780358+DKImprowised@users.noreply.github.com> +ducksecops +emil +fazal +fazal +fjviera +fjvierap +hackerman <3372410+aeneasr@users.noreply.github.com> +hackerman +hisamura333 <0aw2794w78t0b4c@ezweb.ne.jp> +jamesnicolas +javier.viera@mindcurv.com +jayme-github +jess +jhuggett <59655877+jhuggett@users.noreply.github.com> +khevse +kobayashilin +lauri +michaelwagler +mkontani +naveenpaul1 <79908956+naveenpaul1@users.noreply.github.com> +nessita +nishanth2143 +olFi95 +phi2039 +phiremande <16595434+phiremande@users.noreply.github.com> +pike1212 +pike1212 +prateek1192 <1192prateek@gmail.com> +rickwang7712 +robhinds +sagarshah1983 +sawadashota +seremenko-wish <60801091+seremenko-wish@users.noreply.github.com> +simpleway +timothyknight +tutman96 <11356668+tutman96@users.noreply.github.com> +tyaps +vancity-amir <62674577+vancity-amir@users.noreply.github.com> +vinckr +wanderer163 <93438190+wanderer163@users.noreply.github.com> +zepatrik +zepatrik +İbrahim Esen +巢鹏 diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-with_a_different_client_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-with_a_different_client_auth.json new file mode 100644 index 00000000000..5e96525286a --- /dev/null +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-with_a_different_client_auth.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_auth.json new file mode 100644 index 00000000000..73cb36f365a --- /dev/null +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_auth.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_incorrect_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_incorrect_auth.json new file mode 100644 index 00000000000..73cb36f365a --- /dev/null +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_incorrect_auth.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-with_a_different_client_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-with_a_different_client_auth.json new file mode 100644 index 00000000000..5e96525286a --- /dev/null +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-with_a_different_client_auth.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json new file mode 100644 index 00000000000..5c1758cd2c0 --- /dev/null +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials" + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json new file mode 100644 index 00000000000..5c1758cd2c0 --- /dev/null +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials" + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-with_a_different_client_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-with_a_different_client_auth.json new file mode 100644 index 00000000000..5e96525286a --- /dev/null +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-with_a_different_client_auth.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json new file mode 100644 index 00000000000..5c1758cd2c0 --- /dev/null +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials" + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json new file mode 100644 index 00000000000..5c1758cd2c0 --- /dev/null +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials" + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=standard.json b/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=standard.json new file mode 100644 index 00000000000..eca4d4d855a --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=standard.json @@ -0,0 +1,25 @@ +{ + "client_id": "standard-client", + "client_name": "", + "client_secret": "averylongsecret", + "redirect_uris": [ + "http://localhost:3000/cb" + ], + "grant_types": null, + "response_types": null, + "scope": "offline_access offline openid", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "public", + "jwks": {}, + "token_endpoint_auth_method": "client_secret_basic", + "userinfo_signed_response_alg": "none", + "metadata": {} +} diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=metadata_fails.json b/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=metadata_fails.json new file mode 100644 index 00000000000..378b2243d22 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=metadata_fails.json @@ -0,0 +1,4 @@ +{ + "error": "invalid_client_metadata", + "error_description": "The value of one of the Client Metadata fields is invalid and the server has rejected this request. Note that an Authorization Server MAY choose to substitute a valid value for any requested parameter of a Client's Metadata. metadata cannot be set for dynamic client registration'" +} diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=2-description=short_secret_fails.json b/client/.snapshots/TestHandler-common-case=create_clients-case=2-description=short_secret_fails.json new file mode 100644 index 00000000000..b1b5ff4e6ee --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=create_clients-case=2-description=short_secret_fails.json @@ -0,0 +1,4 @@ +{ + "error": "invalid_client_metadata", + "error_description": "The value of one of the Client Metadata fields is invalid and the server has rejected this request. Note that an Authorization Server MAY choose to substitute a valid value for any requested parameter of a Client's Metadata. Field client_secret must contain a secret that is at least 6 characters long." +} diff --git a/client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=admin.json b/client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=admin.json new file mode 100644 index 00000000000..4c93678aba6 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=admin.json @@ -0,0 +1,27 @@ +{ + "body": { + "client_id": "existing-client", + "client_name": "", + "redirect_uris": [ + "http://localhost:3000/cb" + ], + "grant_types": [], + "response_types": [], + "scope": "offline_access offline openid", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": [], + "client_secret_expires_at": 0, + "subject_type": "public", + "jwks": {}, + "token_endpoint_auth_method": "client_secret_basic", + "userinfo_signed_response_alg": "none", + "metadata": {} + }, + "status": 200 +} diff --git a/client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=selfservice-with_correct_client_auth.json b/client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=selfservice-with_correct_client_auth.json new file mode 100644 index 00000000000..56d8f4de4f3 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=selfservice-with_correct_client_auth.json @@ -0,0 +1,26 @@ +{ + "body": { + "client_id": "existing-client", + "client_name": "", + "redirect_uris": [ + "http://localhost:3000/cb" + ], + "grant_types": [], + "response_types": [], + "scope": "offline_access offline openid", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": [], + "client_secret_expires_at": 0, + "subject_type": "public", + "jwks": {}, + "token_endpoint_auth_method": "client_secret_basic", + "userinfo_signed_response_alg": "none" + }, + "status": 200 +} diff --git a/client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-clients-foo.json b/client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-clients-foo.json new file mode 100644 index 00000000000..5b1c8352a82 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-clients-foo.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "Unable to locate the resource", + "error_description": "" + }, + "status": 404 +} diff --git a/client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-connect-register?client_id=foo.json b/client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-connect-register?client_id=foo.json new file mode 100644 index 00000000000..5c1758cd2c0 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-connect-register?client_id=foo.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials" + }, + "status": 401 +} diff --git a/client/doc.go b/client/doc.go index be75582f207..0fd37bf7acc 100644 --- a/client/doc.go +++ b/client/doc.go @@ -29,7 +29,7 @@ package client -// swagger:parameters createOAuth2Client +// swagger:parameters createOAuth2Client selfServiceCreateOAuth2Client type swaggerCreateClientPayload struct { // in: body // required: true @@ -47,11 +47,11 @@ type swaggerUpdateClientPayload struct { Body Client } -// swagger:parameters updateDynOAuth2Client +// swagger:parameters selfServiceUpdateOAuth2Client type swaggerUpdateDynClientPayload struct { - // in: path + // in: query // required: true - ID string `json:"id"` + ID string `json:"client_id"` // in: body // required: true @@ -115,10 +115,9 @@ type swaggerGetOAuth2Client struct { // swagger:parameters getDynOAuth2Client type swaggerGetDynOAuth2Client struct { - // The id of the OAuth 2.0 Client. - // - // in: path - ID string `json:"id"` + // in: query + // required: true + ID string `json:"client_id"` } // swagger:parameters deleteOAuth2Client @@ -129,10 +128,9 @@ type swaggerDeleteOAuth2Client struct { ID string `json:"id"` } -// swagger:parameters deleteDynOAuth2Client +// swagger:parameters selfServiceDeleteOAuth2Client type swaggerDeleteDynOAuth2Client struct { - // The id of the OAuth 2.0 Client. - // - // in: path - ID string `json:"id"` + // in: query + // required: true + ID string `json:"client_id"` } diff --git a/client/handler.go b/client/handler.go index 82b5c7ecfbd..9c60aad2c6d 100644 --- a/client/handler.go +++ b/client/handler.go @@ -27,11 +27,11 @@ import ( "net/http" "time" + "github.com/ory/fosite" + "github.com/ory/x/errorsx" "github.com/ory/herodot" - "github.com/ory/x/sqlcon" - "github.com/ory/hydra/x" "github.com/julienschmidt/httprouter" @@ -79,7 +79,6 @@ func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic, dynami // // OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. // -// // Consumes: // - application/json // @@ -90,9 +89,7 @@ func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic, dynami // // Responses: // 201: oAuth2Client -// 400: jsonError -// 409: jsonError -// 500: jsonError +// default: jsonError func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { c, err := h.create(w, r, h.r.ClientValidator().Validate) if err != nil { @@ -126,9 +123,7 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Pa // // Responses: // 201: oAuth2Client -// 400: genericError -// 409: genericError -// 500: genericError +// default: jsonError func (h *Handler) CreateDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { c, err := h.create(w, r, h.r.ClientValidator().ValidateDynamicRegistration) if err != nil { @@ -139,7 +134,7 @@ func (h *Handler) CreateDynamicRegistration(w http.ResponseWriter, r *http.Reque h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &c) } -func (h *Handler) create(w http.ResponseWriter, r *http.Request, f func(*Client) error) (*Client, error) { +func (h *Handler) create(w http.ResponseWriter, r *http.Request, validator func(*Client) error) (*Client, error) { var c Client if err := json.NewDecoder(r.Body).Decode(&c); err != nil { @@ -154,7 +149,7 @@ func (h *Handler) create(w http.ResponseWriter, r *http.Request, f func(*Client) c.Secret = string(secretb) } - if err := f(&c); err != nil { + if err := validator(&c); err != nil { return nil, err } @@ -189,7 +184,7 @@ func (h *Handler) create(w http.ResponseWriter, r *http.Request, f func(*Client) // // Responses: // 200: oAuth2Client -// 500: jsonError +// default: jsonError func (h *Handler) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var c Client @@ -207,62 +202,6 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request, ps httprouter.P h.r.Writer().Write(w, r, &c) } -// swagger:route PATCH /clients/{id} admin patchOAuth2Client -// -// Patch an OAuth 2.0 Client -// -// Patch an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. -// -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. -// -// Consumes: -// - application/json -// -// Produces: -// - application/json -// -// Schemes: http, https -// -// Responses: -// 200: oAuth2Client -// 500: jsonError -func (h *Handler) Patch(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - patchJSON, err := io.ReadAll(r.Body) - if err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - - id := ps.ByName("id") - c, err := h.r.ClientManager().GetConcreteClient(r.Context(), id) - if err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - - oldSecret := c.Secret - - if err := x.ApplyJSONPatch(patchJSON, c, "/id"); err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - - // fix for #2869 - // GetConcreteClient returns a client with the hashed secret, however updateClient expects - // an empty secret if the secret hasn't changed. As such we need to check if the patch has - // updated the secret or not - if oldSecret == c.Secret { - c.Secret = "" - } - - if err := h.updateClient(r.Context(), c); err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - - h.r.Writer().Write(w, r, c) -} - func (h *Handler) updateClient(ctx context.Context, c *Client) error { var secret string if len(c.Secret) > 0 { @@ -280,7 +219,7 @@ func (h *Handler) updateClient(ctx context.Context, c *Client) error { return nil } -// swagger:route PUT/connect/register public selfServiceUpdateOAuth2Client +// swagger:route PUT /connect/register public selfServiceUpdateOAuth2Client // // Register an OAuth 2.0 Client using OpenID Dynamic Client Registration // @@ -301,7 +240,8 @@ func (h *Handler) updateClient(ctx context.Context, c *Client) error { // // Responses: // 200: oAuth2Client -// 500: genericError +// default: jsonError +// func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { client, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.Form) if err != nil { @@ -311,6 +251,11 @@ func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Reque return } + if err := h.checkID(client, r); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + var c Client if err := json.NewDecoder(r.Body).Decode(&c); err != nil { h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) @@ -338,6 +283,62 @@ func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Reque h.r.Writer().Write(w, r, &c) } +// swagger:route PATCH /clients/{id} admin patchOAuth2Client +// +// Patch an OAuth 2.0 Client +// +// Patch an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. +// +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// Schemes: http, https +// +// Responses: +// 200: oAuth2Client +// default: jsonError +func (h *Handler) Patch(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { + patchJSON, err := io.ReadAll(r.Body) + if err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + id := ps.ByName("id") + c, err := h.r.ClientManager().GetConcreteClient(r.Context(), id) + if err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + oldSecret := c.Secret + + if err := x.ApplyJSONPatch(patchJSON, c, "/id"); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + // fix for #2869 + // GetConcreteClient returns a client with the hashed secret, however updateClient expects + // an empty secret if the secret hasn't changed. As such we need to check if the patch has + // updated the secret or not + if oldSecret == c.Secret { + c.Secret = "" + } + + if err := h.updateClient(r.Context(), c); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + + h.r.Writer().Write(w, r, c) +} + // swagger:parameters listOAuth2Clients type Filter struct { // The maximum amount of clients to returned, upper bound is 500 clients. @@ -377,7 +378,7 @@ type Filter struct { // // Responses: // 200: oAuth2ClientList -// 500: jsonError +// default: jsonError func (h *Handler) List(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { limit, offset := pagination.Parse(r, 100, 0, 500) filters := Filter{ @@ -431,16 +432,12 @@ func (h *Handler) List(w http.ResponseWriter, r *http.Request, ps httprouter.Par // // Responses: // 200: oAuth2Client -// 401: jsonError -// 500: jsonError +// default: jsonError func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var id = ps.ByName("id") c, err := h.r.ClientManager().GetConcreteClient(r.Context(), id) if err != nil { - if errors.Is(err, sqlcon.ErrNoRows) { - err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") - } h.r.Writer().WriteError(w, r, err) return } @@ -468,8 +465,7 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para // // Responses: // 200: oAuth2Client -// 401: genericError -// 500: genericError +// default: jsonError func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { client, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.Form) if err != nil { @@ -479,6 +475,11 @@ func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, return } + if err := h.checkID(client, r); err != nil { + h.r.Writer().WriteError(w, r, err) + return + } + c, err := h.r.ClientManager().GetConcreteClient(r.Context(), client.GetID()) if err != nil { err = herodot.ErrUnauthorized.WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials") @@ -509,8 +510,7 @@ func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, // // Responses: // 204: emptyResponse -// 404: jsonError -// 500: jsonError +// default: jsonError func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var id = ps.ByName("id") if err := h.r.ClientManager().DeleteClient(r.Context(), id); err != nil { @@ -542,14 +542,18 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P // // Responses: // 204: emptyResponse -// 404: genericError -// 500: genericError +// default: jsonError func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { client, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.Form) if err != nil { h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrUnauthorized. WithTrace(err). - WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials").WithDebug(err.Error()))) + WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials.").WithDebug(err.Error()))) + return + } + + if err := h.checkID(client, r); err != nil { + h.r.Writer().WriteError(w, r, err) return } @@ -560,3 +564,11 @@ func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Reque w.WriteHeader(http.StatusNoContent) } + +func (h *Handler) checkID(c fosite.Client, r *http.Request) error { + if r.URL.Query().Get("client_id") != c.GetID() { + return errors.WithStack(herodot.ErrUnauthorized.WithReason("The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request.")) + } + + return nil +} diff --git a/client/handler_test.go b/client/handler_test.go index deddbadaf76..67bdc372100 100644 --- a/client/handler_test.go +++ b/client/handler_test.go @@ -1,207 +1,237 @@ -/* - * Copyright © 2015-2018 Javier Viera - * - * 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. - * - * @author Javier Viera - * @Copyright 2017-2018 Javier Viera - * @license Apache-2.0 - */ - package client_test import ( "bytes" + "encoding/json" + "fmt" + "io" "net/http" "net/http/httptest" "testing" - "github.com/stretchr/testify/require" + "github.com/julienschmidt/httprouter" + "github.com/stretchr/testify/assert" + + "github.com/ory/hydra/x" + "github.com/ory/x/snapshotx" - "github.com/ory/x/urlx" + "github.com/stretchr/testify/require" "github.com/ory/hydra/client" "github.com/ory/hydra/internal" ) -func TestValidateDynClientRegistrationAuthorizationBadReq(t *testing.T) { - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - c := client.Client{OutfacingID: "someid"} - u := "https://www.something.com" - hr := &http.Request{Header: map[string][]string{}, URL: urlx.ParseOrPanic(u), RequestURI: u} - err := h.ValidateDynClientRegistrationAuthorization(hr, c) - require.EqualValues(t, "The request could not be authorized", err.Error()) -} - -func TestValidateDynClientRegistrationAuthorizationBadBasicAuthNoBase64(t *testing.T) { - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - c := client.Client{OutfacingID: "someid"} - u := "https://www.something.com" - hr := &http.Request{Header: map[string][]string{}, URL: urlx.ParseOrPanic(u), RequestURI: u} - hr.Header.Add("Authorization", "Basic something") - err := h.ValidateDynClientRegistrationAuthorization(hr, c) - require.EqualValues(t, "The request could not be authorized", err.Error()) -} - -func TestValidateDynClientRegistrationAuthorizationBadBasicAuthKo(t *testing.T) { - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - c := client.Client{OutfacingID: "client"} - u := "https://www.something.com" - hr := &http.Request{Header: map[string][]string{}, URL: urlx.ParseOrPanic(u), RequestURI: u} - hr.Header.Add("Authorization", "Basic Y2xpZW50OnNlY3JldA==") - err := h.ValidateDynClientRegistrationAuthorization(hr, c) - require.EqualValues(t, "The request could not be authorized", err.Error()) -} - -func TestCreateOk(t *testing.T) { - u := "https://www.something.com" - var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) - req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) - if err != nil { - panic(err) - } - rr := httptest.NewRecorder() - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - h.Create(rr, req, nil) - require.EqualValues(t, http.StatusCreated, rr.Result().StatusCode) -} - -func TestCreateDynamicRegistrationOk(t *testing.T) { - u := "https://www.something.com" - var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) - req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) - if err != nil { - panic(err) - } - rr := httptest.NewRecorder() - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - h.CreateDynamicRegistration(rr, req, nil) - require.EqualValues(t, http.StatusCreated, rr.Result().StatusCode) -} - -func TestUpdateKo(t *testing.T) { - u := "https://www.something.com" - var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) - req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) - if err != nil { - panic(err) - } - rr := httptest.NewRecorder() - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - h.Update(rr, req, nil) - require.EqualValues(t, http.StatusNotFound, rr.Result().StatusCode) +type responseSnapshot struct { + Body json.RawMessage `json:"body"` + Status int `json:"status"` } -func TestPatchKo(t *testing.T) { - u := "https://www.something.com" - var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) - req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) - if err != nil { - panic(err) +func newResponseSnapshot(body string, res *http.Response) *responseSnapshot { + return &responseSnapshot{ + Body: json.RawMessage(body), + Status: res.StatusCode, } - rr := httptest.NewRecorder() - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - h.Patch(rr, req, nil) - require.EqualValues(t, http.StatusNotFound, rr.Result().StatusCode) } -func TestUpdateDynamicRegistrationKo(t *testing.T) { - u := "https://www.something.com" - var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) - req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) - if err != nil { - panic(err) - } - rr := httptest.NewRecorder() +func TestHandler(t *testing.T) { reg := internal.NewMockedRegistry(t) h := client.NewHandler(reg) - h.UpdateDynamicRegistration(rr, req, nil) - require.EqualValues(t, http.StatusUnauthorized, rr.Result().StatusCode) -} -func TestListOk(t *testing.T) { - u := "https://www.something.com" - var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) - req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) - if err != nil { - panic(err) + newServer := func(t *testing.T, dynamicEnabled bool) (*httptest.Server, *http.Client) { + router := httprouter.New() + h.SetRoutes(&x.RouterAdmin{Router: router}, &x.RouterPublic{Router: router}, dynamicEnabled) + ts := httptest.NewServer(router) + t.Cleanup(ts.Close) + return ts, ts.Client() } - rr := httptest.NewRecorder() - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - h.List(rr, req, nil) - require.EqualValues(t, http.StatusOK, rr.Result().StatusCode) -} -func TestGetKo(t *testing.T) { - u := "https://www.something.com" - var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) - req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) - if err != nil { - panic(err) + fetch := func(t *testing.T, url string) (string, *http.Response) { + res, err := http.Get(url) + require.NoError(t, err) + defer res.Body.Close() + body, err := io.ReadAll(res.Body) + require.NoError(t, err) + return string(body), res } - rr := httptest.NewRecorder() - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - h.Get(rr, req, nil) - require.EqualValues(t, http.StatusUnauthorized, rr.Result().StatusCode) -} -func TestGetDynamicRegistrationKo(t *testing.T) { - u := "https://www.something.com" - var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) - req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) - if err != nil { - panic(err) + fetchWithAuth := func(t *testing.T, method, url, username, password string, body io.Reader) (string, *http.Response) { + r, err := http.NewRequest(method, url, body) + require.NoError(t, err) + r.SetBasicAuth(username, password) + res, err := http.DefaultClient.Do(r) + require.NoError(t, err) + defer res.Body.Close() + out, err := io.ReadAll(res.Body) + require.NoError(t, err) + return string(out), res } - rr := httptest.NewRecorder() - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - h.GetDynamicRegistration(rr, req, nil) - require.EqualValues(t, http.StatusUnauthorized, rr.Result().StatusCode) -} -func TestDeleteKo(t *testing.T) { - u := "https://www.something.com" - var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) - req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) - if err != nil { - panic(err) + makeJSON := func(t *testing.T, ts *httptest.Server, method string, path string, body interface{}) (string, *http.Response) { + var b bytes.Buffer + require.NoError(t, json.NewEncoder(&b).Encode(body)) + r, err := http.NewRequest(method, ts.URL+path, &b) + require.NoError(t, err) + r.Header.Set("Content-Type", "application/json") + res, err := ts.Client().Do(r) + require.NoError(t, err) + defer res.Body.Close() + rb, err := io.ReadAll(res.Body) + require.NoError(t, err) + return string(rb), res } - rr := httptest.NewRecorder() - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - h.Delete(rr, req, nil) - require.EqualValues(t, http.StatusNotFound, rr.Result().StatusCode) -} -func TestDeleteDynamicRegistrationKo(t *testing.T) { - u := "https://www.something.com" - var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`) - req, err := http.NewRequest("POST", u, bytes.NewBuffer(jsonStr)) - if err != nil { - panic(err) - } - rr := httptest.NewRecorder() - reg := internal.NewMockedRegistry(t) - h := client.NewHandler(reg) - h.DeleteDynamicRegistration(rr, req, nil) - require.EqualValues(t, http.StatusUnauthorized, rr.Result().StatusCode) + t.Run("selfservice disabled", func(t *testing.T) { + ts, hc := newServer(t, false) + + for _, method := range []string{"GET", "POST", "PUT", "DELETE"} { + t.Run("method="+method, func(t *testing.T) { + req, err := http.NewRequest(method, ts.URL+client.DynClientsHandlerPath, nil) + require.NoError(t, err) + + res, err := hc.Do(req) + require.NoError(t, err) + require.Equal(t, http.StatusNotFound, res.StatusCode) + }) + } + }) + + t.Run("case=selfservice with incorrect or missing auth", func(t *testing.T) { + ts, hc := newServer(t, true) + expected := &client.Client{ + OutfacingID: "incorrect-missing-client", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "client_secret_basic", + } + body, res := makeJSON(t, ts, "POST", client.ClientsHandlerPath, expected) + require.Equal(t, http.StatusCreated, res.StatusCode, body) + + // Create the second client + secondClient := &client.Client{ + OutfacingID: "second-existing-client", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + } + body, res = makeJSON(t, ts, "POST", client.ClientsHandlerPath, secondClient) + require.Equal(t, http.StatusCreated, res.StatusCode, body) + + t.Run("endpoint=selfservice", func(t *testing.T) { + for _, method := range []string{"GET", "DELETE", "PUT"} { + t.Run("method="+method, func(t *testing.T) { + t.Run("without auth", func(t *testing.T) { + req, err := http.NewRequest(method, ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, nil) + require.NoError(t, err) + + res, err := hc.Do(req) + require.NoError(t, err) + defer res.Body.Close() + + body, err := io.ReadAll(res.Body) + require.NoError(t, err) + + snapshotx.SnapshotTExcept(t, newResponseSnapshot(string(body), res), nil) + }) + + t.Run("without incorrect auth", func(t *testing.T) { + body, res := fetchWithAuth(t, method, ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, "incorrect", nil) + assert.Equal(t, http.StatusUnauthorized, res.StatusCode) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) + }) + + t.Run("with a different client auth", func(t *testing.T) { + body, res = fetchWithAuth(t, method, ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, secondClient.OutfacingID, secondClient.Secret, nil) + assert.Equal(t, http.StatusUnauthorized, res.StatusCode) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) + }) + }) + } + }) + }) + + t.Run("common", func(t *testing.T) { + ts, _ := newServer(t, true) + t.Run("case=create clients", func(t *testing.T) { + for k, tc := range []struct { + d string + payload *client.Client + path string + statusCode int + }{ + { + d: "standard", + payload: &client.Client{ + OutfacingID: "standard-client", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + }, + path: client.DynClientsHandlerPath, + statusCode: http.StatusCreated, + }, + { + d: "metadata fails", + payload: &client.Client{ + OutfacingID: "standard-client", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + Metadata: []byte(`{"foo":"bar"}`), + }, + path: client.DynClientsHandlerPath, + statusCode: http.StatusBadRequest, + }, + { + d: "short secret fails", + payload: &client.Client{ + OutfacingID: "standard-client", + Secret: "short", + RedirectURIs: []string{"http://localhost:3000/cb"}, + }, + path: client.DynClientsHandlerPath, + statusCode: http.StatusBadRequest, + }, + } { + t.Run(fmt.Sprintf("case=%d/description=%s", k, tc.d), func(t *testing.T) { + body, res := makeJSON(t, ts, "POST", tc.path, tc.payload) + require.Equal(t, tc.statusCode, res.StatusCode, body) + snapshotx.SnapshotTExcept(t, json.RawMessage(body), []string{"updated_at", "created_at"}) + }) + } + }) + + t.Run("case=fetching client which does not exist", func(t *testing.T) { + for _, path := range []string{ + client.DynClientsHandlerPath + "?client_id=foo", + client.ClientsHandlerPath + "/foo", + } { + t.Run("path="+path, func(t *testing.T) { + body, res := fetch(t, ts.URL+path) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) + }) + } + }) + + t.Run("case=fetching client existing", func(t *testing.T) { + expected := &client.Client{ + OutfacingID: "existing-client", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "client_secret_basic", + } + body, res := makeJSON(t, ts, "POST", client.ClientsHandlerPath, expected) + require.Equal(t, http.StatusCreated, res.StatusCode, body) + + t.Run("endpoint=admin", func(t *testing.T) { + body, res := fetch(t, ts.URL+client.ClientsHandlerPath+"/"+expected.OutfacingID) + assert.Equal(t, http.StatusOK, res.StatusCode) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) + }) + + t.Run("endpoint=selfservice", func(t *testing.T) { + t.Run("with correct client auth", func(t *testing.T) { + body, res = fetchWithAuth(t, "GET", ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, expected.Secret, nil) + assert.Equal(t, http.StatusOK, res.StatusCode) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) + }) + }) + }) + }) } diff --git a/driver/registry_base.go b/driver/registry_base.go index 2542384120c..65ab12bfb43 100644 --- a/driver/registry_base.go +++ b/driver/registry_base.go @@ -501,3 +501,7 @@ func (m *RegistryBase) AccessRequestHooks() []oauth2.AccessRequestHook { } return m.arhs } + +func (m *RegistrySQL) ClientAuthenticator() x.ClientAuthenticator { + return m.OAuth2Provider().(*fosite.Fosite) +} diff --git a/x/authenticator.go b/x/authenticator.go index 1c333fd702c..62e441c232d 100644 --- a/x/authenticator.go +++ b/x/authenticator.go @@ -2,9 +2,10 @@ package x import ( "context" - "github.com/ory/fosite" "net/http" "net/url" + + "github.com/ory/fosite" ) type ClientAuthenticatorProvider interface { From db569684d28e039b2719da4b18556ea85ce965dd Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Sun, 2 Jan 2022 17:31:32 +0200 Subject: [PATCH 27/41] feat: add OpenID Connect Dynamic Client Registration This feature adds first-class support for OpenID Connect Dynamic Client Registration. To enable this feature, which is disabled by default, set ```yaml oidc: dynamic_client_registration: enabled: true ``` in your Ory Hydra configuration. Once enabled, endpoints `POST`, `GET`, `PUT`, and `DELETE` for `/openid/register` will be available at the public port! Closes #2568 Closes #2549 --- ...t=selfservice-method=GET-without_auth.json | 2 +- ...ice-method=GET-without_incorrect_auth.json | 2 +- ...t=selfservice-method=PUT-without_auth.json | 2 +- ...ice-method=PUT-without_incorrect_auth.json | 2 +- ...on=basic_dynamic_client_registration.json} | 2 +- ...-description=basic_admin_registration.json | 27 ++ ...ails_for_dynamic_client_registration.json} | 0 ...ase=3-description=short_secret_fails.json} | 0 ...on-existing_client-path=-clients-foo.json} | 0 ...-path=-connect-register?client_id=foo.json | 7 + ...rent_self-service_auth_methods-case=0.json | 26 ++ ...ent_self-service_auth_methods-case=1.json} | 2 +- ...rent_self-service_auth_methods-case=2.json | 7 + ...rent_self-service_auth_methods-case=3.json | 26 ++ ...ching_existing_client-endpoint=admin.json} | 0 ...existing_client-endpoint=selfservice.json} | 0 ...non-existing_client-path=-clients-foo.json | 7 + ...-path=-connect-register?client_id=foo.json | 7 + ...mon-case=patching_non-existing_client.json | 7 + ...dating_existing_client-endpoint=admin.json | 29 ++ ..._existing_client-endpoint=selfservice.json | 29 ++ ...nt_fails_with_metadat_on_self_service.json | 7 + ...non-existing_client-path=-clients-foo.json | 7 + ...-path=-connect-register?client_id=foo.json | 7 + client/handler.go | 169 +++---- client/handler_test.go | 243 +++++++++- ...id-connect-dynamic-client-registration.mdx | 90 ++++ docs/sidebar.json | 1 + driver/config/provider.go | 2 +- .../accept_consent_request_parameters.go | 49 +- .../admin/accept_consent_request_responses.go | 12 +- .../admin/accept_login_request_parameters.go | 49 +- .../admin/accept_login_request_responses.go | 18 +- .../admin/accept_logout_request_parameters.go | 45 +- .../admin/accept_logout_request_responses.go | 12 +- .../httpclient/client/admin/admin_client.go | 108 ++--- .../create_json_web_key_set_parameters.go | 50 +-- .../create_json_web_key_set_responses.go | 15 +- .../admin/create_o_auth2_client_parameters.go | 45 +- .../admin/create_o_auth2_client_responses.go | 106 +---- .../admin/delete_json_web_key_parameters.go | 51 +-- .../admin/delete_json_web_key_responses.go | 16 +- .../delete_json_web_key_set_parameters.go | 46 +- .../delete_json_web_key_set_responses.go | 16 +- .../admin/delete_o_auth2_client_parameters.go | 46 +- .../admin/delete_o_auth2_client_responses.go | 71 +-- .../admin/delete_o_auth2_token_parameters.go | 45 +- .../admin/delete_o_auth2_token_responses.go | 13 +- ...h_inactive_jwt_bearer_grants_parameters.go | 135 ------ ...sh_inactive_jwt_bearer_grants_responses.go | 97 ---- ...lush_inactive_o_auth2_tokens_parameters.go | 45 +- ...flush_inactive_o_auth2_tokens_responses.go | 13 +- .../admin/get_consent_request_parameters.go | 45 +- .../admin/get_consent_request_responses.go | 15 +- .../admin/get_json_web_key_parameters.go | 51 +-- .../admin/get_json_web_key_responses.go | 12 +- .../admin/get_json_web_key_set_parameters.go | 46 +- .../admin/get_json_web_key_set_responses.go | 15 +- .../admin/get_login_request_parameters.go | 45 +- .../admin/get_login_request_responses.go | 18 +- .../admin/get_logout_request_parameters.go | 45 +- .../admin/get_logout_request_responses.go | 15 +- .../admin/get_o_auth2_client_parameters.go | 46 +- .../admin/get_o_auth2_client_responses.go | 70 +-- .../client/admin/get_version_parameters.go | 42 +- .../client/admin/get_version_responses.go | 6 +- .../introspect_o_auth2_token_parameters.go | 56 +-- .../introspect_o_auth2_token_responses.go | 12 +- .../admin/is_instance_alive_parameters.go | 42 +- .../admin/is_instance_alive_responses.go | 9 +- .../admin/list_o_auth2_clients_responses.go | 40 +- ...ist_subject_consent_sessions_parameters.go | 45 +- ...list_subject_consent_sessions_responses.go | 12 +- .../admin/patch_o_auth2_client_parameters.go | 48 +- .../admin/patch_o_auth2_client_responses.go | 40 +- .../reject_consent_request_parameters.go | 49 +- .../admin/reject_consent_request_responses.go | 12 +- .../admin/reject_login_request_parameters.go | 49 +- .../admin/reject_login_request_responses.go | 18 +- .../admin/reject_logout_request_parameters.go | 49 +- .../admin/reject_logout_request_responses.go | 13 +- ...evoke_authentication_session_parameters.go | 45 +- ...revoke_authentication_session_responses.go | 13 +- .../revoke_consent_sessions_parameters.go | 63 +-- .../revoke_consent_sessions_responses.go | 13 +- .../admin/update_json_web_key_parameters.go | 55 +-- .../admin/update_json_web_key_responses.go | 15 +- .../update_json_web_key_set_parameters.go | 50 +-- .../update_json_web_key_set_responses.go | 15 +- .../admin/update_o_auth2_client_parameters.go | 48 +- .../admin/update_o_auth2_client_responses.go | 40 +- .../client/metadata/metadata_client.go | 17 +- .../client/metadata/prometheus_parameters.go | 42 +- .../client/metadata/prometheus_responses.go | 7 +- ...create_o_auth2_client_public_parameters.go | 126 ------ .../create_o_auth2_client_public_responses.go | 181 -------- ...delete_o_auth2_client_public_parameters.go | 126 ------ .../delete_o_auth2_client_public_responses.go | 133 ------ .../public/disconnect_user_parameters.go | 42 +- .../public/disconnect_user_responses.go | 7 +- ...scover_open_id_configuration_parameters.go | 42 +- ...iscover_open_id_configuration_responses.go | 12 +- .../get_o_auth2_client_public_parameters.go | 126 ------ .../get_o_auth2_client_public_responses.go | 143 ------ .../public/is_instance_ready_parameters.go | 42 +- .../public/is_instance_ready_responses.go | 9 +- .../client/public/oauth2_token_parameters.go | 60 +-- .../client/public/oauth2_token_responses.go | 15 +- .../client/public/oauth_auth_parameters.go | 42 +- .../client/public/oauth_auth_responses.go | 13 +- .../httpclient/client/public/public_client.go | 419 +++++++++--------- .../public/revoke_o_auth2_token_parameters.go | 44 +- .../public/revoke_o_auth2_token_responses.go | 13 +- ...ervice_create_o_auth2_client_parameters.go | 135 ++++++ ...service_create_o_auth2_client_responses.go | 117 +++++ ...ervice_delete_o_auth2_client_parameters.go | 136 ++++++ ...service_delete_o_auth2_client_responses.go | 106 +++++ ...f_service_get_o_auth2_client_parameters.go | 112 +++++ ...lf_service_get_o_auth2_client_responses.go | 117 +++++ ...ervice_update_o_auth2_client_parameters.go | 157 +++++++ ...service_update_o_auth2_client_responses.go | 117 +++++ ...update_o_auth2_client_public_parameters.go | 126 ------ .../update_o_auth2_client_public_responses.go | 105 ----- .../client/public/userinfo_parameters.go | 42 +- .../client/public/userinfo_responses.go | 12 +- .../client/public/well_known_parameters.go | 42 +- .../client/public/well_known_responses.go | 9 +- .../models/accept_consent_request.go | 82 +--- .../httpclient/models/accept_login_request.go | 7 - .../httpclient/models/completed_request.go | 7 - internal/httpclient/models/consent_request.go | 84 +--- .../models/consent_request_session.go | 7 - .../models/container_wait_o_k_body_error.go | 7 - ...flush_inactive_jwt_bearer_grants_params.go | 69 --- .../flush_inactive_o_auth2_tokens_request.go | 8 +- internal/httpclient/models/generic_error.go | 22 +- .../models/health_not_ready_status.go | 7 - internal/httpclient/models/health_status.go | 7 - internal/httpclient/models/json_error.go | 11 - internal/httpclient/models/json_web_key.go | 23 - .../httpclient/models/json_web_key_set.go | 34 +- .../json_web_key_set_generator_request.go | 7 - internal/httpclient/models/login_request.go | 81 +--- internal/httpclient/models/logout_request.go | 31 +- internal/httpclient/models/null_time.go | 7 - internal/httpclient/models/o_auth2_client.go | 153 +------ .../models/o_auth2_token_introspection.go | 7 - .../models/oauth2_token_response.go | 7 - .../models/open_id_connect_context.go | 7 - internal/httpclient/models/patch_document.go | 9 - internal/httpclient/models/patch_request.go | 24 - internal/httpclient/models/plugin_config.go | 165 +------ .../httpclient/models/plugin_config_args.go | 7 - .../models/plugin_config_interface.go | 33 -- .../models/plugin_config_linux_swagger.go | 33 -- .../models/plugin_config_network.go | 7 - .../httpclient/models/plugin_config_rootfs.go | 7 - .../httpclient/models/plugin_config_user.go | 7 - internal/httpclient/models/plugin_device.go | 7 - internal/httpclient/models/plugin_env.go | 7 - .../models/plugin_interface_type.go | 7 - internal/httpclient/models/plugin_mount.go | 7 - internal/httpclient/models/plugin_settings.go | 55 --- .../models/previous_consent_session.go | 101 +---- internal/httpclient/models/reject_request.go | 7 - .../models/request_was_handled_response.go | 7 - .../models/string_slice_pipe_delimiter.go | 7 - .../httpclient/models/userinfo_response.go | 7 - internal/httpclient/models/version.go | 7 - internal/httpclient/models/volume.go | 39 +- .../httpclient/models/volume_usage_data.go | 7 - internal/httpclient/models/well_known.go | 12 - spec/api.json | 205 ++++++--- spec/config.json | 17 +- 174 files changed, 3076 insertions(+), 4519 deletions(-) rename client/.snapshots/{TestHandler-common-case=create_clients-case=0-description=standard.json => TestHandler-common-case=create_clients-case=0-description=basic_dynamic_client_registration.json} (94%) create mode 100644 client/.snapshots/TestHandler-common-case=create_clients-case=1-description=basic_admin_registration.json rename client/.snapshots/{TestHandler-common-case=create_clients-case=1-description=metadata_fails.json => TestHandler-common-case=create_clients-case=2-description=metadata_fails_for_dynamic_client_registration.json} (100%) rename client/.snapshots/{TestHandler-common-case=create_clients-case=2-description=short_secret_fails.json => TestHandler-common-case=create_clients-case=3-description=short_secret_fails.json} (100%) rename client/.snapshots/{TestHandler-common-case=fetching_client_which_does_not_exist-path=-clients-foo.json => TestHandler-common-case=delete_non-existing_client-path=-clients-foo.json} (100%) create mode 100644 client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-connect-register?client_id=foo.json create mode 100644 client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=0.json rename client/.snapshots/{TestHandler-common-case=fetching_client_which_does_not_exist-path=-connect-register?client_id=foo.json => TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=1.json} (72%) create mode 100644 client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=2.json create mode 100644 client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=3.json rename client/.snapshots/{TestHandler-common-case=fetching_client_existing-endpoint=admin.json => TestHandler-common-case=fetching_existing_client-endpoint=admin.json} (100%) rename client/.snapshots/{TestHandler-common-case=fetching_client_existing-endpoint=selfservice-with_correct_client_auth.json => TestHandler-common-case=fetching_existing_client-endpoint=selfservice.json} (100%) create mode 100644 client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-clients-foo.json create mode 100644 client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-connect-register?client_id=foo.json create mode 100644 client/.snapshots/TestHandler-common-case=patching_non-existing_client.json create mode 100644 client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=admin.json create mode 100644 client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=selfservice.json create mode 100644 client/.snapshots/TestHandler-common-case=updating_existing_client_fails_with_metadat_on_self_service.json create mode 100644 client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-clients-foo.json create mode 100644 client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-connect-register?client_id=foo.json create mode 100644 docs/docs/guides/openid-connect-dynamic-client-registration.mdx delete mode 100644 internal/httpclient/client/admin/flush_inactive_jwt_bearer_grants_parameters.go delete mode 100644 internal/httpclient/client/admin/flush_inactive_jwt_bearer_grants_responses.go delete mode 100644 internal/httpclient/client/public/create_o_auth2_client_public_parameters.go delete mode 100644 internal/httpclient/client/public/create_o_auth2_client_public_responses.go delete mode 100644 internal/httpclient/client/public/delete_o_auth2_client_public_parameters.go delete mode 100644 internal/httpclient/client/public/delete_o_auth2_client_public_responses.go delete mode 100644 internal/httpclient/client/public/get_o_auth2_client_public_parameters.go delete mode 100644 internal/httpclient/client/public/get_o_auth2_client_public_responses.go create mode 100644 internal/httpclient/client/public/self_service_create_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/self_service_create_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/self_service_delete_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/self_service_delete_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/self_service_get_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/self_service_get_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/self_service_update_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/self_service_update_o_auth2_client_responses.go delete mode 100644 internal/httpclient/client/public/update_o_auth2_client_public_parameters.go delete mode 100644 internal/httpclient/client/public/update_o_auth2_client_public_responses.go delete mode 100644 internal/httpclient/models/flush_inactive_jwt_bearer_grants_params.go diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json index 5c1758cd2c0..73cb36f365a 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials" + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json index 5c1758cd2c0..73cb36f365a 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials" + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json index 5c1758cd2c0..73cb36f365a 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials" + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json index 5c1758cd2c0..73cb36f365a 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials" + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=standard.json b/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=basic_dynamic_client_registration.json similarity index 94% rename from client/.snapshots/TestHandler-common-case=create_clients-case=0-description=standard.json rename to client/.snapshots/TestHandler-common-case=create_clients-case=0-description=basic_dynamic_client_registration.json index eca4d4d855a..5a7a1b92cbb 100644 --- a/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=standard.json +++ b/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=basic_dynamic_client_registration.json @@ -1,5 +1,5 @@ { - "client_id": "standard-client", + "client_id": "create-client-1", "client_name": "", "client_secret": "averylongsecret", "redirect_uris": [ diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=basic_admin_registration.json b/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=basic_admin_registration.json new file mode 100644 index 00000000000..6552f5a15e8 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=basic_admin_registration.json @@ -0,0 +1,27 @@ +{ + "client_id": "create-client-2", + "client_name": "", + "client_secret": "averylongsecret", + "redirect_uris": [ + "http://localhost:3000/cb" + ], + "grant_types": null, + "response_types": null, + "scope": "offline_access offline openid", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "public", + "jwks": {}, + "token_endpoint_auth_method": "client_secret_basic", + "userinfo_signed_response_alg": "none", + "metadata": { + "foo": "bar" + } +} diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=metadata_fails.json b/client/.snapshots/TestHandler-common-case=create_clients-case=2-description=metadata_fails_for_dynamic_client_registration.json similarity index 100% rename from client/.snapshots/TestHandler-common-case=create_clients-case=1-description=metadata_fails.json rename to client/.snapshots/TestHandler-common-case=create_clients-case=2-description=metadata_fails_for_dynamic_client_registration.json diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=2-description=short_secret_fails.json b/client/.snapshots/TestHandler-common-case=create_clients-case=3-description=short_secret_fails.json similarity index 100% rename from client/.snapshots/TestHandler-common-case=create_clients-case=2-description=short_secret_fails.json rename to client/.snapshots/TestHandler-common-case=create_clients-case=3-description=short_secret_fails.json diff --git a/client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-clients-foo.json b/client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-clients-foo.json similarity index 100% rename from client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-clients-foo.json rename to client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-clients-foo.json diff --git a/client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-connect-register?client_id=foo.json b/client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-connect-register?client_id=foo.json new file mode 100644 index 00000000000..5e96525286a --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-connect-register?client_id=foo.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=0.json b/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=0.json new file mode 100644 index 00000000000..77ff70f8101 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=0.json @@ -0,0 +1,26 @@ +{ + "body": { + "client_id": "get-client-auth-1", + "client_name": "", + "redirect_uris": [ + "http://localhost:3000/cb" + ], + "grant_types": [], + "response_types": [], + "scope": "offline_access offline openid", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": [], + "client_secret_expires_at": 0, + "subject_type": "public", + "jwks": {}, + "token_endpoint_auth_method": "client_secret_basic", + "userinfo_signed_response_alg": "none" + }, + "status": 200 +} diff --git a/client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-connect-register?client_id=foo.json b/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=1.json similarity index 72% rename from client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-connect-register?client_id=foo.json rename to client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=1.json index 5c1758cd2c0..73cb36f365a 100644 --- a/client/.snapshots/TestHandler-common-case=fetching_client_which_does_not_exist-path=-connect-register?client_id=foo.json +++ b/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=1.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials" + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=2.json b/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=2.json new file mode 100644 index 00000000000..73cb36f365a --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=2.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=3.json b/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=3.json new file mode 100644 index 00000000000..3745d0bac05 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=3.json @@ -0,0 +1,26 @@ +{ + "body": { + "client_id": "get-client-auth-4", + "client_name": "", + "redirect_uris": [ + "http://localhost:3000/cb" + ], + "grant_types": [], + "response_types": [], + "scope": "offline_access offline openid", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": [], + "client_secret_expires_at": 0, + "subject_type": "public", + "jwks": {}, + "token_endpoint_auth_method": "client_secret_post", + "userinfo_signed_response_alg": "none" + }, + "status": 200 +} diff --git a/client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=admin.json b/client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=admin.json similarity index 100% rename from client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=admin.json rename to client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=admin.json diff --git a/client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=selfservice-with_correct_client_auth.json b/client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=selfservice.json similarity index 100% rename from client/.snapshots/TestHandler-common-case=fetching_client_existing-endpoint=selfservice-with_correct_client_auth.json rename to client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=selfservice.json diff --git a/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-clients-foo.json b/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-clients-foo.json new file mode 100644 index 00000000000..5b1c8352a82 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-clients-foo.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "Unable to locate the resource", + "error_description": "" + }, + "status": 404 +} diff --git a/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-connect-register?client_id=foo.json b/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-connect-register?client_id=foo.json new file mode 100644 index 00000000000..5e96525286a --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-connect-register?client_id=foo.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-common-case=patching_non-existing_client.json b/client/.snapshots/TestHandler-common-case=patching_non-existing_client.json new file mode 100644 index 00000000000..5b1c8352a82 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=patching_non-existing_client.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "Unable to locate the resource", + "error_description": "" + }, + "status": 404 +} diff --git a/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=admin.json b/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=admin.json new file mode 100644 index 00000000000..5b7ef762567 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=admin.json @@ -0,0 +1,29 @@ +{ + "body": { + "client_id": "update-existing-client-admin", + "client_name": "", + "client_secret": "averylongsecret", + "redirect_uris": [ + "http://localhost:3000/cb", + "https://foobar.com" + ], + "grant_types": null, + "response_types": null, + "scope": "offline_access offline openid", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "public", + "jwks": {}, + "token_endpoint_auth_method": "client_secret_basic", + "userinfo_signed_response_alg": "none", + "metadata": {} + }, + "status": 200 +} diff --git a/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=selfservice.json b/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=selfservice.json new file mode 100644 index 00000000000..ff0f1d157c4 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=selfservice.json @@ -0,0 +1,29 @@ +{ + "body": { + "client_id": "update-existing-client-selfservice", + "client_name": "", + "client_secret": "anothersecret", + "redirect_uris": [ + "http://localhost:3000/cb", + "https://foobar.com" + ], + "grant_types": null, + "response_types": null, + "scope": "offline_access offline openid", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "public", + "jwks": {}, + "token_endpoint_auth_method": "client_secret_basic", + "userinfo_signed_response_alg": "none", + "metadata": {} + }, + "status": 200 +} diff --git a/client/.snapshots/TestHandler-common-case=updating_existing_client_fails_with_metadat_on_self_service.json b/client/.snapshots/TestHandler-common-case=updating_existing_client_fails_with_metadat_on_self_service.json new file mode 100644 index 00000000000..4564a266965 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=updating_existing_client_fails_with_metadat_on_self_service.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "invalid_client_metadata", + "error_description": "The value of one of the Client Metadata fields is invalid and the server has rejected this request. Note that an Authorization Server MAY choose to substitute a valid value for any requested parameter of a Client's Metadata. metadata cannot be set for dynamic client registration'" + }, + "status": 400 +} diff --git a/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-clients-foo.json b/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-clients-foo.json new file mode 100644 index 00000000000..5b1c8352a82 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-clients-foo.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "Unable to locate the resource", + "error_description": "" + }, + "status": 404 +} diff --git a/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-connect-register?client_id=foo.json b/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-connect-register?client_id=foo.json new file mode 100644 index 00000000000..5e96525286a --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-connect-register?client_id=foo.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." + }, + "status": 401 +} diff --git a/client/handler.go b/client/handler.go index 9c60aad2c6d..14eded6a16c 100644 --- a/client/handler.go +++ b/client/handler.go @@ -75,9 +75,12 @@ func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic, dynami // // Create an OAuth 2.0 Client // -// Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. +// Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret +// will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. +// Write the secret down and keep it somwhere safe. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +// generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. // // Consumes: // - application/json @@ -104,13 +107,14 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Pa // // Register an OAuth 2.0 Client using OpenID Dynamic Client Registration // -// This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is facing the public internet. This -// feature needs to be enabled in the configuration. +// This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the +// public internet directly and can be used in self-service. It implements the OpenID Connect +// Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +// is disabled by default. It can be enabled by an administrator. // // Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be -// generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe. -// -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. +// generated. The secret will be returned in the response and you will not be able to retrieve it later on. +// Write the secret down and keep it somewhere safe. // // // Consumes: @@ -170,9 +174,11 @@ func (h *Handler) create(w http.ResponseWriter, r *http.Request, validator func( // // Update an OAuth 2.0 Client // -// Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. +// Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. +// This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +// generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. // // Consumes: // - application/json @@ -189,12 +195,12 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request, ps httprouter.P var c Client if err := json.NewDecoder(r.Body).Decode(&c); err != nil { - h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) + h.r.Writer().WriteError(w, r, errorsx.WithStack(herodot.ErrBadRequest.WithReasonf("Unable to decode the request body: %s", err))) return } c.OutfacingID = ps.ByName("id") - if err := h.updateClient(r.Context(), &c); err != nil { + if err := h.updateClient(r.Context(), &c, h.r.ClientValidator().Validate); err != nil { h.r.Writer().WriteError(w, r, err) return } @@ -202,12 +208,13 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request, ps httprouter.P h.r.Writer().Write(w, r, &c) } -func (h *Handler) updateClient(ctx context.Context, c *Client) error { +func (h *Handler) updateClient(ctx context.Context, c *Client, validator func(*Client) error) error { var secret string if len(c.Secret) > 0 { secret = c.Secret } - if err := h.r.ClientValidator().Validate(c); err != nil { + + if err := validator(c); err != nil { return err } @@ -221,14 +228,22 @@ func (h *Handler) updateClient(ctx context.Context, c *Client) error { // swagger:route PUT /connect/register public selfServiceUpdateOAuth2Client // -// Register an OAuth 2.0 Client using OpenID Dynamic Client Registration +// Update an OAuth 2.0 Client using OpenID Dynamic Client Registration +// +// This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is capable of facing the +// public internet directly and can be used in self-service. It implements the OpenID Connect +// Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +// is disabled by default. It can be enabled by an administrator. // -// This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is facing the public internet and can be -// used in self-service. This feature needs to be enabled in the configuration. +// If you pass `client_secret` the secret will be updated and returned via the API. +// This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. // -// Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. +// To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client +// uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. +// If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +// generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. // // Consumes: // - application/json @@ -243,15 +258,8 @@ func (h *Handler) updateClient(ctx context.Context, c *Client) error { // default: jsonError // func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - client, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.Form) + client, err := h.validDynamicAuth(r) if err != nil { - h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrUnauthorized. - WithTrace(err). - WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials").WithDebug(err.Error()))) - return - } - - if err := h.checkID(client, r); err != nil { h.r.Writer().WriteError(w, r, err) return } @@ -262,24 +270,12 @@ func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Reque return } - var secret string - if len(c.Secret) > 0 { - secret = c.Secret - } - c.OutfacingID = client.GetID() - if err := h.r.ClientValidator().ValidateDynamicRegistration(&c); err != nil { - h.r.Writer().WriteError(w, r, err) - return - } - - c.UpdatedAt = time.Now().UTC().Round(time.Second) - if err := h.r.ClientManager().UpdateClient(r.Context(), &c); err != nil { + if err := h.updateClient(r.Context(), &c, h.r.ClientValidator().ValidateDynamicRegistration); err != nil { h.r.Writer().WriteError(w, r, err) return } - c.Secret = secret h.r.Writer().Write(w, r, &c) } @@ -287,9 +283,12 @@ func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Reque // // Patch an OAuth 2.0 Client // -// Patch an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. +// Patch an existing OAuth 2.0 Client. If you pass `client_secret` +// the secret will be updated and returned via the API. This is the +// only time you will be able to retrieve the client secret, so write it down and keep it safe. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +// generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. // // Consumes: // - application/json @@ -331,7 +330,7 @@ func (h *Handler) Patch(w http.ResponseWriter, r *http.Request, ps httprouter.Pa c.Secret = "" } - if err := h.updateClient(r.Context(), c); err != nil { + if err := h.updateClient(r.Context(), c, h.r.ClientValidator().Validate); err != nil { h.r.Writer().WriteError(w, r, err) return } @@ -362,9 +361,13 @@ type Filter struct { // // List OAuth 2.0 Clients // -// This endpoint lists all clients in the database, and never returns client secrets. As a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects. +// This endpoint lists all clients in the database, and never returns client secrets. +// As a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, +// but it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects. +// +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +// generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. // The "Link" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '; rel="{page}"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. // Multiple links can be included in this header, and will be separated by a comma. // @@ -415,12 +418,12 @@ func (h *Handler) List(w http.ResponseWriter, r *http.Request, ps httprouter.Par // swagger:route GET /clients/{id} admin getOAuth2Client // -// Get an OAuth 2.0 Client. +// Get an OAuth 2.0 Client // -// Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. -// -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret. // +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +// generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. // // Consumes: // - application/json @@ -448,12 +451,19 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para // swagger:route GET /connect/register public selfServiceGetOAuth2Client // -// Get an OAuth 2.0 Client. +// Get an OAuth 2.0 Client using OpenID Dynamic Client Registration // -// Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. +// This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the +// public internet directly and can be used in self-service. It implements the OpenID Connect +// Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +// is disabled by default. It can be enabled by an administrator. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. +// To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client +// uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. +// If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. // +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +// generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. // // Consumes: // - application/json @@ -467,15 +477,8 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para // 200: oAuth2Client // default: jsonError func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - client, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.Form) + client, err := h.validDynamicAuth(r) if err != nil { - h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrUnauthorized. - WithTrace(err). - WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials").WithDebug(err.Error()))) - return - } - - if err := h.checkID(client, r); err != nil { h.r.Writer().WriteError(w, r, err) return } @@ -498,7 +501,10 @@ func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, // // Delete an existing OAuth 2.0 Client by its ID. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +// generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. +// +// Make sure that this endpoint is well protected and only callable by first-party components. // // Consumes: // - application/json @@ -525,15 +531,17 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P // // Deletes an OAuth 2.0 Client using OpenID Dynamic Client Registration // -// This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is facing the public internet and can be -// used in self-service. This feature needs to be enabled in the configuration. +// This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of facing the +// public internet directly and can be used in self-service. It implements the OpenID Connect +// Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +// is disabled by default. It can be enabled by an administrator. // -// Delete an existing OAuth 2.0 Client by its ID. +// To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client +// uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. +// If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. // -// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. -// -// Consumes: -// - application/json +// OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +// generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. // // Produces: // - application/json @@ -544,15 +552,8 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P // 204: emptyResponse // default: jsonError func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - client, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.Form) + client, err := h.validDynamicAuth(r) if err != nil { - h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrUnauthorized. - WithTrace(err). - WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials.").WithDebug(err.Error()))) - return - } - - if err := h.checkID(client, r); err != nil { h.r.Writer().WriteError(w, r, err) return } @@ -565,10 +566,22 @@ func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Reque w.WriteHeader(http.StatusNoContent) } -func (h *Handler) checkID(c fosite.Client, r *http.Request) error { +func (h *Handler) validDynamicAuth(r *http.Request) (fosite.Client, error) { + // We use the query parameters instead of the body because the body is not available in this context. + c, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.URL.Query()) + if err != nil { + return nil, herodot.ErrUnauthorized. + WithTrace(err). + WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials.").WithDebug(err.Error()) + } + if r.URL.Query().Get("client_id") != c.GetID() { - return errors.WithStack(herodot.ErrUnauthorized.WithReason("The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request.")) + return nil, errors.WithStack(herodot.ErrUnauthorized.WithReason("The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request.")) } - return nil + if c.(fosite.OpenIDConnectClient).GetTokenEndpointAuthMethod() == "none" { + return nil, errors.WithStack(herodot.ErrUnauthorized.WithReason("Public OAuth 2.0 Clients can not be managed using OpenID Connect Dynamic Client Registration.")) + } + + return c, nil } diff --git a/client/handler_test.go b/client/handler_test.go index 67bdc372100..b80e8939016 100644 --- a/client/handler_test.go +++ b/client/handler_test.go @@ -80,6 +80,11 @@ func TestHandler(t *testing.T) { return string(rb), res } + createClient := func(t *testing.T, c *client.Client, ts *httptest.Server, path string) { + body, res := makeJSON(t, ts, "POST", path, c) + require.Equal(t, http.StatusCreated, res.StatusCode, body) + } + t.Run("selfservice disabled", func(t *testing.T) { ts, hc := newServer(t, false) @@ -103,8 +108,7 @@ func TestHandler(t *testing.T) { RedirectURIs: []string{"http://localhost:3000/cb"}, TokenEndpointAuthMethod: "client_secret_basic", } - body, res := makeJSON(t, ts, "POST", client.ClientsHandlerPath, expected) - require.Equal(t, http.StatusCreated, res.StatusCode, body) + createClient(t, expected, ts, client.ClientsHandlerPath) // Create the second client secondClient := &client.Client{ @@ -112,8 +116,7 @@ func TestHandler(t *testing.T) { Secret: "averylongsecret", RedirectURIs: []string{"http://localhost:3000/cb"}, } - body, res = makeJSON(t, ts, "POST", client.ClientsHandlerPath, secondClient) - require.Equal(t, http.StatusCreated, res.StatusCode, body) + createClient(t, secondClient, ts, client.ClientsHandlerPath) t.Run("endpoint=selfservice", func(t *testing.T) { for _, method := range []string{"GET", "DELETE", "PUT"} { @@ -139,7 +142,7 @@ func TestHandler(t *testing.T) { }) t.Run("with a different client auth", func(t *testing.T) { - body, res = fetchWithAuth(t, method, ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, secondClient.OutfacingID, secondClient.Secret, nil) + body, res := fetchWithAuth(t, method, ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, secondClient.OutfacingID, secondClient.Secret, nil) assert.Equal(t, http.StatusUnauthorized, res.StatusCode) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) }) @@ -150,6 +153,14 @@ func TestHandler(t *testing.T) { t.Run("common", func(t *testing.T) { ts, _ := newServer(t, true) + expected := &client.Client{ + OutfacingID: "existing-client", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "client_secret_basic", + } + createClient(t, expected, ts, client.ClientsHandlerPath) + t.Run("case=create clients", func(t *testing.T) { for k, tc := range []struct { d string @@ -158,9 +169,9 @@ func TestHandler(t *testing.T) { statusCode int }{ { - d: "standard", + d: "basic dynamic client registration", payload: &client.Client{ - OutfacingID: "standard-client", + OutfacingID: "create-client-1", Secret: "averylongsecret", RedirectURIs: []string{"http://localhost:3000/cb"}, }, @@ -168,9 +179,20 @@ func TestHandler(t *testing.T) { statusCode: http.StatusCreated, }, { - d: "metadata fails", + d: "basic admin registration", payload: &client.Client{ - OutfacingID: "standard-client", + OutfacingID: "create-client-2", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + Metadata: []byte(`{"foo":"bar"}`), + }, + path: client.ClientsHandlerPath, + statusCode: http.StatusCreated, + }, + { + d: "metadata fails for dynamic client registration", + payload: &client.Client{ + OutfacingID: "create-client-3", Secret: "averylongsecret", RedirectURIs: []string{"http://localhost:3000/cb"}, Metadata: []byte(`{"foo":"bar"}`), @@ -181,7 +203,7 @@ func TestHandler(t *testing.T) { { d: "short secret fails", payload: &client.Client{ - OutfacingID: "standard-client", + OutfacingID: "create-client-4", Secret: "short", RedirectURIs: []string{"http://localhost:3000/cb"}, }, @@ -197,41 +219,218 @@ func TestHandler(t *testing.T) { } }) - t.Run("case=fetching client which does not exist", func(t *testing.T) { + t.Run("case=fetching non-existing client", func(t *testing.T) { + for _, path := range []string{ + client.DynClientsHandlerPath + "?client_id=foo", + client.ClientsHandlerPath + "/foo", + } { + t.Run("path="+path, func(t *testing.T) { + body, res := fetchWithAuth(t, "GET", ts.URL+path, expected.OutfacingID, expected.Secret, nil) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) + }) + } + }) + + t.Run("case=updating non-existing client", func(t *testing.T) { for _, path := range []string{ client.DynClientsHandlerPath + "?client_id=foo", client.ClientsHandlerPath + "/foo", } { t.Run("path="+path, func(t *testing.T) { - body, res := fetch(t, ts.URL+path) + body, res := fetchWithAuth(t, "PUT", ts.URL+path, expected.OutfacingID, expected.Secret, bytes.NewBufferString("{}")) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) }) } }) - t.Run("case=fetching client existing", func(t *testing.T) { + t.Run("case=delete non-existing client", func(t *testing.T) { + for _, path := range []string{ + client.DynClientsHandlerPath + "?client_id=foo", + client.ClientsHandlerPath + "/foo", + } { + t.Run("path="+path, func(t *testing.T) { + body, res := fetchWithAuth(t, "DELETE", ts.URL+path, expected.OutfacingID, expected.Secret, nil) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) + }) + } + }) + + t.Run("case=patching non-existing client", func(t *testing.T) { + body, res := fetchWithAuth(t, "PATCH", ts.URL+client.ClientsHandlerPath+"/foo", expected.OutfacingID, expected.Secret, nil) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) + }) + + t.Run("case=fetching existing client", func(t *testing.T) { + t.Run("endpoint=admin", func(t *testing.T) { + body, res := fetch(t, ts.URL+client.ClientsHandlerPath+"/"+expected.OutfacingID) + assert.Equal(t, http.StatusOK, res.StatusCode) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) + }) + + t.Run("endpoint=selfservice", func(t *testing.T) { + body, res := fetchWithAuth(t, "GET", ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, expected.Secret, nil) + assert.Equal(t, http.StatusOK, res.StatusCode) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) + }) + }) + + t.Run("case=updating existing client fails with metadat on self service", func(t *testing.T) { expected := &client.Client{ - OutfacingID: "existing-client", + OutfacingID: "update-existing-client-selfservice-metadata", Secret: "averylongsecret", RedirectURIs: []string{"http://localhost:3000/cb"}, TokenEndpointAuthMethod: "client_secret_basic", } - body, res := makeJSON(t, ts, "POST", client.ClientsHandlerPath, expected) - require.Equal(t, http.StatusCreated, res.StatusCode, body) + createClient(t, expected, ts, client.ClientsHandlerPath) + + // Possible to update the secret + expected.Metadata = []byte(`{"foo":"bar"}`) + payload, err := json.Marshal(expected) + require.NoError(t, err) + body, res := fetchWithAuth(t, "PUT", ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, expected.Secret, bytes.NewReader(payload)) + assert.Equal(t, http.StatusBadRequest, res.StatusCode) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) + }) + + t.Run("case=updating existing client", func(t *testing.T) { t.Run("endpoint=admin", func(t *testing.T) { - body, res := fetch(t, ts.URL+client.ClientsHandlerPath+"/"+expected.OutfacingID) + expected := &client.Client{ + OutfacingID: "update-existing-client-admin", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "client_secret_basic", + } + createClient(t, expected, ts, client.ClientsHandlerPath) + + expected.RedirectURIs = append(expected.RedirectURIs, "https://foobar.com") + body, res := makeJSON(t, ts, "PUT", client.ClientsHandlerPath+"/"+expected.OutfacingID, expected) assert.Equal(t, http.StatusOK, res.StatusCode) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) }) t.Run("endpoint=selfservice", func(t *testing.T) { - t.Run("with correct client auth", func(t *testing.T) { - body, res = fetchWithAuth(t, "GET", ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, expected.Secret, nil) - assert.Equal(t, http.StatusOK, res.StatusCode) - snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) - }) + expected := &client.Client{ + OutfacingID: "update-existing-client-selfservice", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "client_secret_basic", + } + createClient(t, expected, ts, client.ClientsHandlerPath) + + // Possible to update the secret + expected.Secret = "anothersecret" + expected.RedirectURIs = append(expected.RedirectURIs, "https://foobar.com") + payload, err := json.Marshal(expected) + require.NoError(t, err) + + body, res := fetchWithAuth(t, "PUT", ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, "averylongsecret", bytes.NewReader(payload)) + assert.Equal(t, http.StatusOK, res.StatusCode) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) + }) + }) + + t.Run("case=delete existing client", func(t *testing.T) { + t.Run("endpoint=admin", func(t *testing.T) { + expected := &client.Client{ + OutfacingID: "delete-existing-client-admin", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "client_secret_basic", + } + body, res := makeJSON(t, ts, "POST", client.ClientsHandlerPath, expected) + require.Equal(t, http.StatusCreated, res.StatusCode, body) + + _, res = makeJSON(t, ts, "DELETE", client.ClientsHandlerPath+"/"+expected.OutfacingID, nil) + assert.Equal(t, http.StatusNoContent, res.StatusCode) }) + + t.Run("endpoint=selfservice", func(t *testing.T) { + expected := &client.Client{ + OutfacingID: "delete-existing-client-selfservice", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "client_secret_basic", + } + body, res := makeJSON(t, ts, "POST", client.ClientsHandlerPath, expected) + require.Equal(t, http.StatusCreated, res.StatusCode, body) + + _, res = fetchWithAuth(t, "DELETE", ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, "averylongsecret", nil) + assert.Equal(t, http.StatusNoContent, res.StatusCode) + }) + }) + + t.Run("case=fetch with different self-service auth methods", func(t *testing.T) { + for k, tc := range []struct { + c *client.Client + r func(t *testing.T, r *http.Request, c *client.Client) + es int + }{ + { + c: &client.Client{ + OutfacingID: "get-client-auth-1", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "client_secret_basic", + }, + r: func(t *testing.T, r *http.Request, c *client.Client) { + r.SetBasicAuth(c.OutfacingID, c.Secret) + }, + es: http.StatusOK, + }, + { + c: &client.Client{ + OutfacingID: "get-client-auth-2", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "none", + }, + r: func(t *testing.T, r *http.Request, c *client.Client) { + r.SetBasicAuth(c.OutfacingID, "") + }, + es: http.StatusUnauthorized, + }, + { + c: &client.Client{ + OutfacingID: "get-client-auth-3", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "none", + }, + r: func(t *testing.T, r *http.Request, c *client.Client) { + r.SetBasicAuth(c.OutfacingID, "random") + }, + es: http.StatusUnauthorized, + }, + { + c: &client.Client{ + OutfacingID: "get-client-auth-4", + Secret: "averylongsecret", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "client_secret_post", + }, + r: func(t *testing.T, r *http.Request, c *client.Client) { + q := r.URL.Query() + q.Set("client_secret", c.Secret) + r.URL.RawQuery = q.Encode() + }, + es: http.StatusOK, + }, + } { + t.Run(fmt.Sprintf("case=%d", k), func(t *testing.T) { + createClient(t, tc.c, ts, client.ClientsHandlerPath) + req, err := http.NewRequest("GET", ts.URL+client.DynClientsHandlerPath+"?client_id="+tc.c.OutfacingID, nil) + require.NoError(t, err) + tc.r(t, req, tc.c) + + res, err := ts.Client().Do(req) + assert.Equal(t, tc.es, res.StatusCode) + require.NoError(t, err) + + body, err := io.ReadAll(res.Body) + require.NoError(t, err) + + snapshotx.SnapshotTExcept(t, newResponseSnapshot(string(body), res), []string{"body.created_at", "body.updated_at"}) + }) + } }) }) } diff --git a/docs/docs/guides/openid-connect-dynamic-client-registration.mdx b/docs/docs/guides/openid-connect-dynamic-client-registration.mdx new file mode 100644 index 00000000000..132462faaae --- /dev/null +++ b/docs/docs/guides/openid-connect-dynamic-client-registration.mdx @@ -0,0 +1,90 @@ +--- +id: openid-connect-dynamic-client-registration +title: OpenID Connect Dynamic Client Registration +--- + +Ory Hydra is capable of exposing [OpenID Connect Dynamic Client Registration](https://openid.net/specs/openid-connect-registration-1_0.html). +This feature allows anonymous users to create OAuth2 Clients in self-service, without administrative privileges. + +This is particularly useful if you are running a public service and want users to be able to create their own OAuth2 clients easily. + +To enable this feature, set the following configuration option: + +```yaml +oidc: + dynamic_client_registration: + enabled: true +``` + +Enabling this feature will add listeners to the following four routes at the public endpoint: + +- `POST /openid/register` - Register a new OAuth2 Client; +- `GET /openid/register?client_id=...` - Fetch the OAuth2 Client; +- `PUT /openid/register?client_id=...` - Update the OAuth2 Client; +- `DELETE /openid/register?client_id=...` - Delete the OAuth2 Client; + +## Register OAuth2 & OpenID Connect Clients + +If OpenID Connect Dynamic Client Registration is enabled, registering a new OAuth2 Client is as simple as: + +``` +POST /openid/register +Content-Type: application/json + +{ + "client_id": "...", + ... +} +``` + +Please note that it is not possible to set OAuth2 Client Metadata using this endpoint. Metadata is a protected +field and can only be set using the administrative endpoint! OAuth2 Client Metadata can also not be read using OpenID Connect Dynamic Client Registration endpoints! + +## Manage OAuth2 & OpenID Connect Clients + +All endpoints except the `POST` one require the client to authenticate with its primary credentials. For example, +if the OAuth2 Client has `token_endpoint_auth_method=client_secret_basic` then it will require the client to authenticate +using basic authorization when, for example, updating information: + +``` +PUT /openid/register?client_id=... +Authorization: Basic +Content-Type: application/json + +{ + "redirect_uris": [...] + ... +} +``` + +If the OAuth2 Client uses `client_secret_post` as the auth method, you need to supply the client secret as a query parameter: + +``` +PUT /openid/register?client_id=...&client_secret=... +Content-Type: application/json + +{ + "redirect_uris": [...] + ... +} +``` + +If the OAuth2 Client uses `private_key_jwt` as the auth method, you supply the appropriate assertion as a query parameter as well: + +``` +PUT /openid/register?client_id=...&client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&client_assertion=... +Content-Type: application/json + +{ + "redirect_uris": [...] + ... +} +``` + +:::info + +It is not possible to manage the OAuth2 Clients with `token_endpoint_auth_method=none` through the API! These clients can only be managed +using administrative endpoints. + +::: + diff --git a/docs/sidebar.json b/docs/sidebar.json index 3d22d0617b1..a1f950dc1dd 100644 --- a/docs/sidebar.json +++ b/docs/sidebar.json @@ -45,6 +45,7 @@ "label": "OAuth2 & OpenID Connect", "items": [ "advanced", + "guides/openid-connect-dynamic-client-registration", "guides/oauth2-clients", "guides/oauth2-grant-type-jwt-bearer", "guides/common-oauth2-openid-connect-flows", diff --git a/driver/config/provider.go b/driver/config/provider.go index 7451fa03f7e..17997cc5eda 100644 --- a/driver/config/provider.go +++ b/driver/config/provider.go @@ -37,7 +37,6 @@ const ( KeyDSN = "dsn" KeyBCryptCost = "oauth2.hashers.bcrypt.cost" KeyEncryptSessionData = "oauth2.session.encrypt_at_rest" - KeyPublicAllowDynamicRegistration = "serve.public.allow_dynamic_registration" KeyCookieSameSiteMode = "serve.cookies.same_site_mode" KeyCookieSameSiteLegacyWorkaround = "serve.cookies.same_site_legacy_workaround" KeyConsentRequestMaxAge = "ttl.login_consent_request" @@ -57,6 +56,7 @@ const ( KeyIssuerURL = "urls.self.issuer" KeyAccessTokenStrategy = "strategies.access_token" KeySubjectIdentifierAlgorithmSalt = "oidc.subject_identifiers.pairwise.salt" + KeyPublicAllowDynamicRegistration = "oidc.dynamic_client_registration.enable" KeyPKCEEnforced = "oauth2.pkce.enforced" KeyPKCEEnforcedForPublicClients = "oauth2.pkce.enforced_for_public_clients" KeyLogLevel = "log.level" diff --git a/internal/httpclient/client/admin/accept_consent_request_parameters.go b/internal/httpclient/client/admin/accept_consent_request_parameters.go index c573076321b..df23ce33395 100644 --- a/internal/httpclient/client/admin/accept_consent_request_parameters.go +++ b/internal/httpclient/client/admin/accept_consent_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewAcceptConsentRequestParams creates a new AcceptConsentRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewAcceptConsentRequestParams creates a new AcceptConsentRequestParams object +// with the default values initialized. func NewAcceptConsentRequestParams() *AcceptConsentRequestParams { + var () return &AcceptConsentRequestParams{ + timeout: cr.DefaultTimeout, } } // NewAcceptConsentRequestParamsWithTimeout creates a new AcceptConsentRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewAcceptConsentRequestParamsWithTimeout(timeout time.Duration) *AcceptConsentRequestParams { + var () return &AcceptConsentRequestParams{ + timeout: timeout, } } // NewAcceptConsentRequestParamsWithContext creates a new AcceptConsentRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewAcceptConsentRequestParamsWithContext(ctx context.Context) *AcceptConsentRequestParams { + var () return &AcceptConsentRequestParams{ + Context: ctx, } } // NewAcceptConsentRequestParamsWithHTTPClient creates a new AcceptConsentRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewAcceptConsentRequestParamsWithHTTPClient(client *http.Client) *AcceptConsentRequestParams { + var () return &AcceptConsentRequestParams{ HTTPClient: client, } } -/* AcceptConsentRequestParams contains all the parameters to send to the API endpoint - for the accept consent request operation. - - Typically these are written to a http.Request. +/*AcceptConsentRequestParams contains all the parameters to send to the API endpoint +for the accept consent request operation typically these are written to a http.Request */ type AcceptConsentRequestParams struct { - // Body. + /*Body*/ Body *models.AcceptConsentRequest - - // ConsentChallenge. + /*ConsentChallenge*/ ConsentChallenge string timeout time.Duration @@ -72,21 +72,6 @@ type AcceptConsentRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the accept consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptConsentRequestParams) WithDefaults() *AcceptConsentRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the accept consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptConsentRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the accept consent request params func (o *AcceptConsentRequestParams) WithTimeout(timeout time.Duration) *AcceptConsentRequestParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *AcceptConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -159,7 +145,6 @@ func (o *AcceptConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrConsentChallenge := o.ConsentChallenge qConsentChallenge := qrConsentChallenge if qConsentChallenge != "" { - if err := r.SetQueryParam("consent_challenge", qConsentChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/accept_consent_request_responses.go b/internal/httpclient/client/admin/accept_consent_request_responses.go index ca1d9bb992e..d192d9dd13d 100644 --- a/internal/httpclient/client/admin/accept_consent_request_responses.go +++ b/internal/httpclient/client/admin/accept_consent_request_responses.go @@ -41,8 +41,9 @@ func (o *AcceptConsentRequestReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewAcceptConsentRequestOK() *AcceptConsentRequestOK { return &AcceptConsentRequestOK{} } -/* AcceptConsentRequestOK describes a response with status code 200, with default header values. +/*AcceptConsentRequestOK handles this case with default header values. completedRequest */ @@ -62,6 +63,7 @@ type AcceptConsentRequestOK struct { func (o *AcceptConsentRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/accept][%d] acceptConsentRequestOK %+v", 200, o.Payload) } + func (o *AcceptConsentRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -83,7 +85,7 @@ func NewAcceptConsentRequestNotFound() *AcceptConsentRequestNotFound { return &AcceptConsentRequestNotFound{} } -/* AcceptConsentRequestNotFound describes a response with status code 404, with default header values. +/*AcceptConsentRequestNotFound handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type AcceptConsentRequestNotFound struct { func (o *AcceptConsentRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/accept][%d] acceptConsentRequestNotFound %+v", 404, o.Payload) } + func (o *AcceptConsentRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewAcceptConsentRequestInternalServerError() *AcceptConsentRequestInternalS return &AcceptConsentRequestInternalServerError{} } -/* AcceptConsentRequestInternalServerError describes a response with status code 500, with default header values. +/*AcceptConsentRequestInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type AcceptConsentRequestInternalServerError struct { func (o *AcceptConsentRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/accept][%d] acceptConsentRequestInternalServerError %+v", 500, o.Payload) } + func (o *AcceptConsentRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/accept_login_request_parameters.go b/internal/httpclient/client/admin/accept_login_request_parameters.go index ad0c47b0d30..20d130fc490 100644 --- a/internal/httpclient/client/admin/accept_login_request_parameters.go +++ b/internal/httpclient/client/admin/accept_login_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewAcceptLoginRequestParams creates a new AcceptLoginRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewAcceptLoginRequestParams creates a new AcceptLoginRequestParams object +// with the default values initialized. func NewAcceptLoginRequestParams() *AcceptLoginRequestParams { + var () return &AcceptLoginRequestParams{ + timeout: cr.DefaultTimeout, } } // NewAcceptLoginRequestParamsWithTimeout creates a new AcceptLoginRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewAcceptLoginRequestParamsWithTimeout(timeout time.Duration) *AcceptLoginRequestParams { + var () return &AcceptLoginRequestParams{ + timeout: timeout, } } // NewAcceptLoginRequestParamsWithContext creates a new AcceptLoginRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewAcceptLoginRequestParamsWithContext(ctx context.Context) *AcceptLoginRequestParams { + var () return &AcceptLoginRequestParams{ + Context: ctx, } } // NewAcceptLoginRequestParamsWithHTTPClient creates a new AcceptLoginRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewAcceptLoginRequestParamsWithHTTPClient(client *http.Client) *AcceptLoginRequestParams { + var () return &AcceptLoginRequestParams{ HTTPClient: client, } } -/* AcceptLoginRequestParams contains all the parameters to send to the API endpoint - for the accept login request operation. - - Typically these are written to a http.Request. +/*AcceptLoginRequestParams contains all the parameters to send to the API endpoint +for the accept login request operation typically these are written to a http.Request */ type AcceptLoginRequestParams struct { - // Body. + /*Body*/ Body *models.AcceptLoginRequest - - // LoginChallenge. + /*LoginChallenge*/ LoginChallenge string timeout time.Duration @@ -72,21 +72,6 @@ type AcceptLoginRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the accept login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptLoginRequestParams) WithDefaults() *AcceptLoginRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the accept login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptLoginRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the accept login request params func (o *AcceptLoginRequestParams) WithTimeout(timeout time.Duration) *AcceptLoginRequestParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *AcceptLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -159,7 +145,6 @@ func (o *AcceptLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s qrLoginChallenge := o.LoginChallenge qLoginChallenge := qrLoginChallenge if qLoginChallenge != "" { - if err := r.SetQueryParam("login_challenge", qLoginChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/accept_login_request_responses.go b/internal/httpclient/client/admin/accept_login_request_responses.go index a92b31dee21..7f4b5a71e50 100644 --- a/internal/httpclient/client/admin/accept_login_request_responses.go +++ b/internal/httpclient/client/admin/accept_login_request_responses.go @@ -53,8 +53,9 @@ func (o *AcceptLoginRequestReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -63,7 +64,7 @@ func NewAcceptLoginRequestOK() *AcceptLoginRequestOK { return &AcceptLoginRequestOK{} } -/* AcceptLoginRequestOK describes a response with status code 200, with default header values. +/*AcceptLoginRequestOK handles this case with default header values. completedRequest */ @@ -74,6 +75,7 @@ type AcceptLoginRequestOK struct { func (o *AcceptLoginRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestOK %+v", 200, o.Payload) } + func (o *AcceptLoginRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -95,7 +97,7 @@ func NewAcceptLoginRequestBadRequest() *AcceptLoginRequestBadRequest { return &AcceptLoginRequestBadRequest{} } -/* AcceptLoginRequestBadRequest describes a response with status code 400, with default header values. +/*AcceptLoginRequestBadRequest handles this case with default header values. jsonError */ @@ -106,6 +108,7 @@ type AcceptLoginRequestBadRequest struct { func (o *AcceptLoginRequestBadRequest) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestBadRequest %+v", 400, o.Payload) } + func (o *AcceptLoginRequestBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -127,7 +130,7 @@ func NewAcceptLoginRequestUnauthorized() *AcceptLoginRequestUnauthorized { return &AcceptLoginRequestUnauthorized{} } -/* AcceptLoginRequestUnauthorized describes a response with status code 401, with default header values. +/*AcceptLoginRequestUnauthorized handles this case with default header values. jsonError */ @@ -138,6 +141,7 @@ type AcceptLoginRequestUnauthorized struct { func (o *AcceptLoginRequestUnauthorized) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestUnauthorized %+v", 401, o.Payload) } + func (o *AcceptLoginRequestUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -159,7 +163,7 @@ func NewAcceptLoginRequestNotFound() *AcceptLoginRequestNotFound { return &AcceptLoginRequestNotFound{} } -/* AcceptLoginRequestNotFound describes a response with status code 404, with default header values. +/*AcceptLoginRequestNotFound handles this case with default header values. jsonError */ @@ -170,6 +174,7 @@ type AcceptLoginRequestNotFound struct { func (o *AcceptLoginRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestNotFound %+v", 404, o.Payload) } + func (o *AcceptLoginRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -191,7 +196,7 @@ func NewAcceptLoginRequestInternalServerError() *AcceptLoginRequestInternalServe return &AcceptLoginRequestInternalServerError{} } -/* AcceptLoginRequestInternalServerError describes a response with status code 500, with default header values. +/*AcceptLoginRequestInternalServerError handles this case with default header values. jsonError */ @@ -202,6 +207,7 @@ type AcceptLoginRequestInternalServerError struct { func (o *AcceptLoginRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestInternalServerError %+v", 500, o.Payload) } + func (o *AcceptLoginRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/accept_logout_request_parameters.go b/internal/httpclient/client/admin/accept_logout_request_parameters.go index aa8727c2724..f5f48782535 100644 --- a/internal/httpclient/client/admin/accept_logout_request_parameters.go +++ b/internal/httpclient/client/admin/accept_logout_request_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAcceptLogoutRequestParams creates a new AcceptLogoutRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewAcceptLogoutRequestParams creates a new AcceptLogoutRequestParams object +// with the default values initialized. func NewAcceptLogoutRequestParams() *AcceptLogoutRequestParams { + var () return &AcceptLogoutRequestParams{ + timeout: cr.DefaultTimeout, } } // NewAcceptLogoutRequestParamsWithTimeout creates a new AcceptLogoutRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewAcceptLogoutRequestParamsWithTimeout(timeout time.Duration) *AcceptLogoutRequestParams { + var () return &AcceptLogoutRequestParams{ + timeout: timeout, } } // NewAcceptLogoutRequestParamsWithContext creates a new AcceptLogoutRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewAcceptLogoutRequestParamsWithContext(ctx context.Context) *AcceptLogoutRequestParams { + var () return &AcceptLogoutRequestParams{ + Context: ctx, } } // NewAcceptLogoutRequestParamsWithHTTPClient creates a new AcceptLogoutRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewAcceptLogoutRequestParamsWithHTTPClient(client *http.Client) *AcceptLogoutRequestParams { + var () return &AcceptLogoutRequestParams{ HTTPClient: client, } } -/* AcceptLogoutRequestParams contains all the parameters to send to the API endpoint - for the accept logout request operation. - - Typically these are written to a http.Request. +/*AcceptLogoutRequestParams contains all the parameters to send to the API endpoint +for the accept logout request operation typically these are written to a http.Request */ type AcceptLogoutRequestParams struct { - // LogoutChallenge. + /*LogoutChallenge*/ LogoutChallenge string timeout time.Duration @@ -67,21 +68,6 @@ type AcceptLogoutRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the accept logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptLogoutRequestParams) WithDefaults() *AcceptLogoutRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the accept logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptLogoutRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the accept logout request params func (o *AcceptLogoutRequestParams) WithTimeout(timeout time.Duration) *AcceptLogoutRequestParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *AcceptLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrLogoutChallenge := o.LogoutChallenge qLogoutChallenge := qrLogoutChallenge if qLogoutChallenge != "" { - if err := r.SetQueryParam("logout_challenge", qLogoutChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/accept_logout_request_responses.go b/internal/httpclient/client/admin/accept_logout_request_responses.go index 4ce46f91696..6cc29964d49 100644 --- a/internal/httpclient/client/admin/accept_logout_request_responses.go +++ b/internal/httpclient/client/admin/accept_logout_request_responses.go @@ -41,8 +41,9 @@ func (o *AcceptLogoutRequestReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewAcceptLogoutRequestOK() *AcceptLogoutRequestOK { return &AcceptLogoutRequestOK{} } -/* AcceptLogoutRequestOK describes a response with status code 200, with default header values. +/*AcceptLogoutRequestOK handles this case with default header values. completedRequest */ @@ -62,6 +63,7 @@ type AcceptLogoutRequestOK struct { func (o *AcceptLogoutRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/accept][%d] acceptLogoutRequestOK %+v", 200, o.Payload) } + func (o *AcceptLogoutRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -83,7 +85,7 @@ func NewAcceptLogoutRequestNotFound() *AcceptLogoutRequestNotFound { return &AcceptLogoutRequestNotFound{} } -/* AcceptLogoutRequestNotFound describes a response with status code 404, with default header values. +/*AcceptLogoutRequestNotFound handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type AcceptLogoutRequestNotFound struct { func (o *AcceptLogoutRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/accept][%d] acceptLogoutRequestNotFound %+v", 404, o.Payload) } + func (o *AcceptLogoutRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewAcceptLogoutRequestInternalServerError() *AcceptLogoutRequestInternalSer return &AcceptLogoutRequestInternalServerError{} } -/* AcceptLogoutRequestInternalServerError describes a response with status code 500, with default header values. +/*AcceptLogoutRequestInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type AcceptLogoutRequestInternalServerError struct { func (o *AcceptLogoutRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/accept][%d] acceptLogoutRequestInternalServerError %+v", 500, o.Payload) } + func (o *AcceptLogoutRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/admin_client.go b/internal/httpclient/client/admin/admin_client.go index cec74f7cfc2..d093ac50cc6 100644 --- a/internal/httpclient/client/admin/admin_client.go +++ b/internal/httpclient/client/admin/admin_client.go @@ -47,8 +47,6 @@ type ClientService interface { DeleteTrustedJwtGrantIssuer(params *DeleteTrustedJwtGrantIssuerParams) (*DeleteTrustedJwtGrantIssuerNoContent, error) - FlushInactiveJwtBearerGrants(params *FlushInactiveJwtBearerGrantsParams) (*FlushInactiveJwtBearerGrantsNoContent, error) - FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams) (*FlushInactiveOAuth2TokensNoContent, error) GetConsentRequest(params *GetConsentRequestParams) (*GetConsentRequestOK, error) @@ -279,9 +277,12 @@ func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams) (*Create /* CreateOAuth2Client creates an o auth 2 0 client - Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. + Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret +will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. +Write the secret down and keep it somwhere safe. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. */ func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams) (*CreateOAuth2ClientCreated, error) { // TODO: Validate the params before sending @@ -309,9 +310,8 @@ func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams) (*CreateOA return success, nil } // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + unexpectedSuccess := result.(*CreateOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } /* @@ -395,7 +395,10 @@ func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams) (*Delete Delete an existing OAuth 2.0 Client by its ID. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. + +Make sure that this endpoint is well protected and only callable by first-party components. */ func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams) (*DeleteOAuth2ClientNoContent, error) { // TODO: Validate the params before sending @@ -423,9 +426,8 @@ func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams) (*DeleteOA return success, nil } // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + unexpectedSuccess := result.(*DeleteOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } /* @@ -504,44 +506,6 @@ func (a *Client) DeleteTrustedJwtGrantIssuer(params *DeleteTrustedJwtGrantIssuer panic(msg) } -/* - FlushInactiveJwtBearerGrants flushes expired jwt bearer grants - - This endpoint flushes expired jwt-bearer grants from the database. You can set a time after which no tokens will be -not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be flushed as they are deleted -automatically when performing the refresh flow. -*/ -func (a *Client) FlushInactiveJwtBearerGrants(params *FlushInactiveJwtBearerGrantsParams) (*FlushInactiveJwtBearerGrantsNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewFlushInactiveJwtBearerGrantsParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "flushInactiveJwtBearerGrants", - Method: "POST", - PathPattern: "/grants/jwt-bearer/flush", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &FlushInactiveJwtBearerGrantsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*FlushInactiveJwtBearerGrantsNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for flushInactiveJwtBearerGrants: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* FlushInactiveOAuth2Tokens flushes expired o auth2 access tokens @@ -780,9 +744,10 @@ func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams) (*GetLogoutReq /* GetOAuth2Client gets an o auth 2 0 client - Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. + Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. */ func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams) (*GetOAuth2ClientOK, error) { // TODO: Validate the params before sending @@ -810,9 +775,8 @@ func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams) (*GetOAuth2Clien return success, nil } // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + unexpectedSuccess := result.(*GetOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } /* @@ -977,9 +941,13 @@ func (a *Client) IsInstanceAlive(params *IsInstanceAliveParams) (*IsInstanceAliv /* ListOAuth2Clients lists o auth 2 0 clients - This endpoint lists all clients in the database, and never returns client secrets. As a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects. + This endpoint lists all clients in the database, and never returns client secrets. +As a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, +but it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. The "Link" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '; rel="{page}"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. */ @@ -1009,9 +977,8 @@ func (a *Client) ListOAuth2Clients(params *ListOAuth2ClientsParams) (*ListOAuth2 return success, nil } // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listOAuth2Clients: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + unexpectedSuccess := result.(*ListOAuth2ClientsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } /* @@ -1095,9 +1062,12 @@ func (a *Client) ListTrustedJwtGrantIssuers(params *ListTrustedJwtGrantIssuersPa /* PatchOAuth2Client patches an o auth 2 0 client - Patch an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. + Patch an existing OAuth 2.0 Client. If you pass `client_secret` +the secret will be updated and returned via the API. This is the +only time you will be able to retrieve the client secret, so write it down and keep it safe. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. */ func (a *Client) PatchOAuth2Client(params *PatchOAuth2ClientParams) (*PatchOAuth2ClientOK, error) { // TODO: Validate the params before sending @@ -1125,9 +1095,8 @@ func (a *Client) PatchOAuth2Client(params *PatchOAuth2ClientParams) (*PatchOAuth return success, nil } // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + unexpectedSuccess := result.(*PatchOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } /* @@ -1458,9 +1427,11 @@ func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams) (*Update /* UpdateOAuth2Client updates an o auth 2 0 client - Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. + Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. +This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. */ func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams) (*UpdateOAuth2ClientOK, error) { // TODO: Validate the params before sending @@ -1488,9 +1459,8 @@ func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams) (*UpdateOA return success, nil } // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateOAuth2Client: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + unexpectedSuccess := result.(*UpdateOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } // SetTransport changes the transport on the client diff --git a/internal/httpclient/client/admin/create_json_web_key_set_parameters.go b/internal/httpclient/client/admin/create_json_web_key_set_parameters.go index 43acf4eba80..e4c1c054393 100644 --- a/internal/httpclient/client/admin/create_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/create_json_web_key_set_parameters.go @@ -18,55 +18,55 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewCreateJSONWebKeySetParams creates a new CreateJSONWebKeySetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCreateJSONWebKeySetParams creates a new CreateJSONWebKeySetParams object +// with the default values initialized. func NewCreateJSONWebKeySetParams() *CreateJSONWebKeySetParams { + var () return &CreateJSONWebKeySetParams{ + timeout: cr.DefaultTimeout, } } // NewCreateJSONWebKeySetParamsWithTimeout creates a new CreateJSONWebKeySetParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCreateJSONWebKeySetParamsWithTimeout(timeout time.Duration) *CreateJSONWebKeySetParams { + var () return &CreateJSONWebKeySetParams{ + timeout: timeout, } } // NewCreateJSONWebKeySetParamsWithContext creates a new CreateJSONWebKeySetParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCreateJSONWebKeySetParamsWithContext(ctx context.Context) *CreateJSONWebKeySetParams { + var () return &CreateJSONWebKeySetParams{ + Context: ctx, } } // NewCreateJSONWebKeySetParamsWithHTTPClient creates a new CreateJSONWebKeySetParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCreateJSONWebKeySetParamsWithHTTPClient(client *http.Client) *CreateJSONWebKeySetParams { + var () return &CreateJSONWebKeySetParams{ HTTPClient: client, } } -/* CreateJSONWebKeySetParams contains all the parameters to send to the API endpoint - for the create Json web key set operation. - - Typically these are written to a http.Request. +/*CreateJSONWebKeySetParams contains all the parameters to send to the API endpoint +for the create Json web key set operation typically these are written to a http.Request */ type CreateJSONWebKeySetParams struct { - // Body. + /*Body*/ Body *models.JSONWebKeySetGeneratorRequest + /*Set + The set - /* Set. - - The set */ Set string @@ -75,21 +75,6 @@ type CreateJSONWebKeySetParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the create Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateJSONWebKeySetParams) WithDefaults() *CreateJSONWebKeySetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateJSONWebKeySetParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the create Json web key set params func (o *CreateJSONWebKeySetParams) WithTimeout(timeout time.Duration) *CreateJSONWebKeySetParams { o.SetTimeout(timeout) @@ -152,6 +137,7 @@ func (o *CreateJSONWebKeySetParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/create_json_web_key_set_responses.go b/internal/httpclient/client/admin/create_json_web_key_set_responses.go index 564e5d51f39..9e2515c969b 100644 --- a/internal/httpclient/client/admin/create_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/create_json_web_key_set_responses.go @@ -47,8 +47,9 @@ func (o *CreateJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewCreateJSONWebKeySetCreated() *CreateJSONWebKeySetCreated { return &CreateJSONWebKeySetCreated{} } -/* CreateJSONWebKeySetCreated describes a response with status code 201, with default header values. +/*CreateJSONWebKeySetCreated handles this case with default header values. JSONWebKeySet */ @@ -68,6 +69,7 @@ type CreateJSONWebKeySetCreated struct { func (o *CreateJSONWebKeySetCreated) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetCreated %+v", 201, o.Payload) } + func (o *CreateJSONWebKeySetCreated) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -89,7 +91,7 @@ func NewCreateJSONWebKeySetUnauthorized() *CreateJSONWebKeySetUnauthorized { return &CreateJSONWebKeySetUnauthorized{} } -/* CreateJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. +/*CreateJSONWebKeySetUnauthorized handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type CreateJSONWebKeySetUnauthorized struct { func (o *CreateJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetUnauthorized %+v", 401, o.Payload) } + func (o *CreateJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewCreateJSONWebKeySetForbidden() *CreateJSONWebKeySetForbidden { return &CreateJSONWebKeySetForbidden{} } -/* CreateJSONWebKeySetForbidden describes a response with status code 403, with default header values. +/*CreateJSONWebKeySetForbidden handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type CreateJSONWebKeySetForbidden struct { func (o *CreateJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetForbidden %+v", 403, o.Payload) } + func (o *CreateJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewCreateJSONWebKeySetInternalServerError() *CreateJSONWebKeySetInternalSer return &CreateJSONWebKeySetInternalServerError{} } -/* CreateJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. +/*CreateJSONWebKeySetInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type CreateJSONWebKeySetInternalServerError struct { func (o *CreateJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetInternalServerError %+v", 500, o.Payload) } + func (o *CreateJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/create_o_auth2_client_parameters.go b/internal/httpclient/client/admin/create_o_auth2_client_parameters.go index f719021b83a..c3ce0633992 100644 --- a/internal/httpclient/client/admin/create_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/create_o_auth2_client_parameters.go @@ -18,50 +18,51 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewCreateOAuth2ClientParams creates a new CreateOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCreateOAuth2ClientParams creates a new CreateOAuth2ClientParams object +// with the default values initialized. func NewCreateOAuth2ClientParams() *CreateOAuth2ClientParams { + var () return &CreateOAuth2ClientParams{ + timeout: cr.DefaultTimeout, } } // NewCreateOAuth2ClientParamsWithTimeout creates a new CreateOAuth2ClientParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCreateOAuth2ClientParamsWithTimeout(timeout time.Duration) *CreateOAuth2ClientParams { + var () return &CreateOAuth2ClientParams{ + timeout: timeout, } } // NewCreateOAuth2ClientParamsWithContext creates a new CreateOAuth2ClientParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCreateOAuth2ClientParamsWithContext(ctx context.Context) *CreateOAuth2ClientParams { + var () return &CreateOAuth2ClientParams{ + Context: ctx, } } // NewCreateOAuth2ClientParamsWithHTTPClient creates a new CreateOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCreateOAuth2ClientParamsWithHTTPClient(client *http.Client) *CreateOAuth2ClientParams { + var () return &CreateOAuth2ClientParams{ HTTPClient: client, } } -/* CreateOAuth2ClientParams contains all the parameters to send to the API endpoint - for the create o auth2 client operation. - - Typically these are written to a http.Request. +/*CreateOAuth2ClientParams contains all the parameters to send to the API endpoint +for the create o auth2 client operation typically these are written to a http.Request */ type CreateOAuth2ClientParams struct { - // Body. + /*Body*/ Body *models.OAuth2Client timeout time.Duration @@ -69,21 +70,6 @@ type CreateOAuth2ClientParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the create o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateOAuth2ClientParams) WithDefaults() *CreateOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the create o auth2 client params func (o *CreateOAuth2ClientParams) WithTimeout(timeout time.Duration) *CreateOAuth2ClientParams { o.SetTimeout(timeout) @@ -135,6 +121,7 @@ func (o *CreateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/create_o_auth2_client_responses.go b/internal/httpclient/client/admin/create_o_auth2_client_responses.go index f4b2e9685bb..8de27d13ec0 100644 --- a/internal/httpclient/client/admin/create_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/create_o_auth2_client_responses.go @@ -29,26 +29,15 @@ func (o *CreateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return result, nil - case 400: - result := NewCreateOAuth2ClientBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreateOAuth2ClientConflict() + default: + result := NewCreateOAuth2ClientDefault(response.Code()) if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } - return nil, result - case 500: - result := NewCreateOAuth2ClientInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err + if response.Code()/100 == 2 { + return result, nil } return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -57,7 +46,7 @@ func NewCreateOAuth2ClientCreated() *CreateOAuth2ClientCreated { return &CreateOAuth2ClientCreated{} } -/* CreateOAuth2ClientCreated describes a response with status code 201, with default header values. +/*CreateOAuth2ClientCreated handles this case with default header values. oAuth2Client */ @@ -68,6 +57,7 @@ type CreateOAuth2ClientCreated struct { func (o *CreateOAuth2ClientCreated) Error() string { return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientCreated %+v", 201, o.Payload) } + func (o *CreateOAuth2ClientCreated) GetPayload() *models.OAuth2Client { return o.Payload } @@ -84,91 +74,37 @@ func (o *CreateOAuth2ClientCreated) readResponse(response runtime.ClientResponse return nil } -// NewCreateOAuth2ClientBadRequest creates a CreateOAuth2ClientBadRequest with default headers values -func NewCreateOAuth2ClientBadRequest() *CreateOAuth2ClientBadRequest { - return &CreateOAuth2ClientBadRequest{} -} - -/* CreateOAuth2ClientBadRequest describes a response with status code 400, with default header values. - -jsonError -*/ -type CreateOAuth2ClientBadRequest struct { - Payload *models.JSONError -} - -func (o *CreateOAuth2ClientBadRequest) Error() string { - return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientBadRequest %+v", 400, o.Payload) -} -func (o *CreateOAuth2ClientBadRequest) GetPayload() *models.JSONError { - return o.Payload -} - -func (o *CreateOAuth2ClientBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JSONError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err +// NewCreateOAuth2ClientDefault creates a CreateOAuth2ClientDefault with default headers values +func NewCreateOAuth2ClientDefault(code int) *CreateOAuth2ClientDefault { + return &CreateOAuth2ClientDefault{ + _statusCode: code, } - - return nil } -// NewCreateOAuth2ClientConflict creates a CreateOAuth2ClientConflict with default headers values -func NewCreateOAuth2ClientConflict() *CreateOAuth2ClientConflict { - return &CreateOAuth2ClientConflict{} -} - -/* CreateOAuth2ClientConflict describes a response with status code 409, with default header values. +/*CreateOAuth2ClientDefault handles this case with default header values. jsonError */ -type CreateOAuth2ClientConflict struct { - Payload *models.JSONError -} - -func (o *CreateOAuth2ClientConflict) Error() string { - return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientConflict %+v", 409, o.Payload) -} -func (o *CreateOAuth2ClientConflict) GetPayload() *models.JSONError { - return o.Payload -} - -func (o *CreateOAuth2ClientConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JSONError) +type CreateOAuth2ClientDefault struct { + _statusCode int - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil + Payload *models.JSONError } -// NewCreateOAuth2ClientInternalServerError creates a CreateOAuth2ClientInternalServerError with default headers values -func NewCreateOAuth2ClientInternalServerError() *CreateOAuth2ClientInternalServerError { - return &CreateOAuth2ClientInternalServerError{} +// Code gets the status code for the create o auth2 client default response +func (o *CreateOAuth2ClientDefault) Code() int { + return o._statusCode } -/* CreateOAuth2ClientInternalServerError describes a response with status code 500, with default header values. - -jsonError -*/ -type CreateOAuth2ClientInternalServerError struct { - Payload *models.JSONError +func (o *CreateOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[POST /clients][%d] createOAuth2Client default %+v", o._statusCode, o.Payload) } -func (o *CreateOAuth2ClientInternalServerError) Error() string { - return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientInternalServerError %+v", 500, o.Payload) -} -func (o *CreateOAuth2ClientInternalServerError) GetPayload() *models.JSONError { +func (o *CreateOAuth2ClientDefault) GetPayload() *models.JSONError { return o.Payload } -func (o *CreateOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *CreateOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.JSONError) diff --git a/internal/httpclient/client/admin/delete_json_web_key_parameters.go b/internal/httpclient/client/admin/delete_json_web_key_parameters.go index c1e71f1d5d8..4f4f4fa4401 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_parameters.go +++ b/internal/httpclient/client/admin/delete_json_web_key_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteJSONWebKeyParams creates a new DeleteJSONWebKeyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDeleteJSONWebKeyParams creates a new DeleteJSONWebKeyParams object +// with the default values initialized. func NewDeleteJSONWebKeyParams() *DeleteJSONWebKeyParams { + var () return &DeleteJSONWebKeyParams{ + timeout: cr.DefaultTimeout, } } // NewDeleteJSONWebKeyParamsWithTimeout creates a new DeleteJSONWebKeyParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDeleteJSONWebKeyParamsWithTimeout(timeout time.Duration) *DeleteJSONWebKeyParams { + var () return &DeleteJSONWebKeyParams{ + timeout: timeout, } } // NewDeleteJSONWebKeyParamsWithContext creates a new DeleteJSONWebKeyParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDeleteJSONWebKeyParamsWithContext(ctx context.Context) *DeleteJSONWebKeyParams { + var () return &DeleteJSONWebKeyParams{ + Context: ctx, } } // NewDeleteJSONWebKeyParamsWithHTTPClient creates a new DeleteJSONWebKeyParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDeleteJSONWebKeyParamsWithHTTPClient(client *http.Client) *DeleteJSONWebKeyParams { + var () return &DeleteJSONWebKeyParams{ HTTPClient: client, } } -/* DeleteJSONWebKeyParams contains all the parameters to send to the API endpoint - for the delete Json web key operation. - - Typically these are written to a http.Request. +/*DeleteJSONWebKeyParams contains all the parameters to send to the API endpoint +for the delete Json web key operation typically these are written to a http.Request */ type DeleteJSONWebKeyParams struct { - /* Kid. + /*Kid + The kid of the desired key - The kid of the desired key */ Kid string + /*Set + The set - /* Set. - - The set */ Set string @@ -76,21 +76,6 @@ type DeleteJSONWebKeyParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the delete Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteJSONWebKeyParams) WithDefaults() *DeleteJSONWebKeyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteJSONWebKeyParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the delete Json web key params func (o *DeleteJSONWebKeyParams) WithTimeout(timeout time.Duration) *DeleteJSONWebKeyParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/delete_json_web_key_responses.go b/internal/httpclient/client/admin/delete_json_web_key_responses.go index d5331905a2c..6caea37bb35 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_responses.go +++ b/internal/httpclient/client/admin/delete_json_web_key_responses.go @@ -47,8 +47,9 @@ func (o *DeleteJSONWebKeyReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,9 +58,9 @@ func NewDeleteJSONWebKeyNoContent() *DeleteJSONWebKeyNoContent { return &DeleteJSONWebKeyNoContent{} } -/* DeleteJSONWebKeyNoContent describes a response with status code 204, with default header values. +/*DeleteJSONWebKeyNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteJSONWebKeyNoContent struct { @@ -79,7 +80,7 @@ func NewDeleteJSONWebKeyUnauthorized() *DeleteJSONWebKeyUnauthorized { return &DeleteJSONWebKeyUnauthorized{} } -/* DeleteJSONWebKeyUnauthorized describes a response with status code 401, with default header values. +/*DeleteJSONWebKeyUnauthorized handles this case with default header values. jsonError */ @@ -90,6 +91,7 @@ type DeleteJSONWebKeyUnauthorized struct { func (o *DeleteJSONWebKeyUnauthorized) Error() string { return fmt.Sprintf("[DELETE /keys/{set}/{kid}][%d] deleteJsonWebKeyUnauthorized %+v", 401, o.Payload) } + func (o *DeleteJSONWebKeyUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -111,7 +113,7 @@ func NewDeleteJSONWebKeyForbidden() *DeleteJSONWebKeyForbidden { return &DeleteJSONWebKeyForbidden{} } -/* DeleteJSONWebKeyForbidden describes a response with status code 403, with default header values. +/*DeleteJSONWebKeyForbidden handles this case with default header values. jsonError */ @@ -122,6 +124,7 @@ type DeleteJSONWebKeyForbidden struct { func (o *DeleteJSONWebKeyForbidden) Error() string { return fmt.Sprintf("[DELETE /keys/{set}/{kid}][%d] deleteJsonWebKeyForbidden %+v", 403, o.Payload) } + func (o *DeleteJSONWebKeyForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -143,7 +146,7 @@ func NewDeleteJSONWebKeyInternalServerError() *DeleteJSONWebKeyInternalServerErr return &DeleteJSONWebKeyInternalServerError{} } -/* DeleteJSONWebKeyInternalServerError describes a response with status code 500, with default header values. +/*DeleteJSONWebKeyInternalServerError handles this case with default header values. jsonError */ @@ -154,6 +157,7 @@ type DeleteJSONWebKeyInternalServerError struct { func (o *DeleteJSONWebKeyInternalServerError) Error() string { return fmt.Sprintf("[DELETE /keys/{set}/{kid}][%d] deleteJsonWebKeyInternalServerError %+v", 500, o.Payload) } + func (o *DeleteJSONWebKeyInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go b/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go index 5bb84e5a07a..a6e06c48d86 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteJSONWebKeySetParams creates a new DeleteJSONWebKeySetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDeleteJSONWebKeySetParams creates a new DeleteJSONWebKeySetParams object +// with the default values initialized. func NewDeleteJSONWebKeySetParams() *DeleteJSONWebKeySetParams { + var () return &DeleteJSONWebKeySetParams{ + timeout: cr.DefaultTimeout, } } // NewDeleteJSONWebKeySetParamsWithTimeout creates a new DeleteJSONWebKeySetParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDeleteJSONWebKeySetParamsWithTimeout(timeout time.Duration) *DeleteJSONWebKeySetParams { + var () return &DeleteJSONWebKeySetParams{ + timeout: timeout, } } // NewDeleteJSONWebKeySetParamsWithContext creates a new DeleteJSONWebKeySetParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDeleteJSONWebKeySetParamsWithContext(ctx context.Context) *DeleteJSONWebKeySetParams { + var () return &DeleteJSONWebKeySetParams{ + Context: ctx, } } // NewDeleteJSONWebKeySetParamsWithHTTPClient creates a new DeleteJSONWebKeySetParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDeleteJSONWebKeySetParamsWithHTTPClient(client *http.Client) *DeleteJSONWebKeySetParams { + var () return &DeleteJSONWebKeySetParams{ HTTPClient: client, } } -/* DeleteJSONWebKeySetParams contains all the parameters to send to the API endpoint - for the delete Json web key set operation. - - Typically these are written to a http.Request. +/*DeleteJSONWebKeySetParams contains all the parameters to send to the API endpoint +for the delete Json web key set operation typically these are written to a http.Request */ type DeleteJSONWebKeySetParams struct { - /* Set. + /*Set + The set - The set */ Set string @@ -70,21 +71,6 @@ type DeleteJSONWebKeySetParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the delete Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteJSONWebKeySetParams) WithDefaults() *DeleteJSONWebKeySetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteJSONWebKeySetParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the delete Json web key set params func (o *DeleteJSONWebKeySetParams) WithTimeout(timeout time.Duration) *DeleteJSONWebKeySetParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/delete_json_web_key_set_responses.go b/internal/httpclient/client/admin/delete_json_web_key_set_responses.go index 26ff80c09f9..7e769a6c132 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/delete_json_web_key_set_responses.go @@ -47,8 +47,9 @@ func (o *DeleteJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,9 +58,9 @@ func NewDeleteJSONWebKeySetNoContent() *DeleteJSONWebKeySetNoContent { return &DeleteJSONWebKeySetNoContent{} } -/* DeleteJSONWebKeySetNoContent describes a response with status code 204, with default header values. +/*DeleteJSONWebKeySetNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteJSONWebKeySetNoContent struct { @@ -79,7 +80,7 @@ func NewDeleteJSONWebKeySetUnauthorized() *DeleteJSONWebKeySetUnauthorized { return &DeleteJSONWebKeySetUnauthorized{} } -/* DeleteJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. +/*DeleteJSONWebKeySetUnauthorized handles this case with default header values. jsonError */ @@ -90,6 +91,7 @@ type DeleteJSONWebKeySetUnauthorized struct { func (o *DeleteJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[DELETE /keys/{set}][%d] deleteJsonWebKeySetUnauthorized %+v", 401, o.Payload) } + func (o *DeleteJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -111,7 +113,7 @@ func NewDeleteJSONWebKeySetForbidden() *DeleteJSONWebKeySetForbidden { return &DeleteJSONWebKeySetForbidden{} } -/* DeleteJSONWebKeySetForbidden describes a response with status code 403, with default header values. +/*DeleteJSONWebKeySetForbidden handles this case with default header values. jsonError */ @@ -122,6 +124,7 @@ type DeleteJSONWebKeySetForbidden struct { func (o *DeleteJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[DELETE /keys/{set}][%d] deleteJsonWebKeySetForbidden %+v", 403, o.Payload) } + func (o *DeleteJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -143,7 +146,7 @@ func NewDeleteJSONWebKeySetInternalServerError() *DeleteJSONWebKeySetInternalSer return &DeleteJSONWebKeySetInternalServerError{} } -/* DeleteJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. +/*DeleteJSONWebKeySetInternalServerError handles this case with default header values. jsonError */ @@ -154,6 +157,7 @@ type DeleteJSONWebKeySetInternalServerError struct { func (o *DeleteJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[DELETE /keys/{set}][%d] deleteJsonWebKeySetInternalServerError %+v", 500, o.Payload) } + func (o *DeleteJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go b/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go index 313a6b76fdf..6eb2b90b311 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteOAuth2ClientParams creates a new DeleteOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDeleteOAuth2ClientParams creates a new DeleteOAuth2ClientParams object +// with the default values initialized. func NewDeleteOAuth2ClientParams() *DeleteOAuth2ClientParams { + var () return &DeleteOAuth2ClientParams{ + timeout: cr.DefaultTimeout, } } // NewDeleteOAuth2ClientParamsWithTimeout creates a new DeleteOAuth2ClientParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDeleteOAuth2ClientParamsWithTimeout(timeout time.Duration) *DeleteOAuth2ClientParams { + var () return &DeleteOAuth2ClientParams{ + timeout: timeout, } } // NewDeleteOAuth2ClientParamsWithContext creates a new DeleteOAuth2ClientParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDeleteOAuth2ClientParamsWithContext(ctx context.Context) *DeleteOAuth2ClientParams { + var () return &DeleteOAuth2ClientParams{ + Context: ctx, } } // NewDeleteOAuth2ClientParamsWithHTTPClient creates a new DeleteOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDeleteOAuth2ClientParamsWithHTTPClient(client *http.Client) *DeleteOAuth2ClientParams { + var () return &DeleteOAuth2ClientParams{ HTTPClient: client, } } -/* DeleteOAuth2ClientParams contains all the parameters to send to the API endpoint - for the delete o auth2 client operation. - - Typically these are written to a http.Request. +/*DeleteOAuth2ClientParams contains all the parameters to send to the API endpoint +for the delete o auth2 client operation typically these are written to a http.Request */ type DeleteOAuth2ClientParams struct { - /* ID. + /*ID + The id of the OAuth 2.0 Client. - The id of the OAuth 2.0 Client. */ ID string @@ -70,21 +71,6 @@ type DeleteOAuth2ClientParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the delete o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteOAuth2ClientParams) WithDefaults() *DeleteOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the delete o auth2 client params func (o *DeleteOAuth2ClientParams) WithTimeout(timeout time.Duration) *DeleteOAuth2ClientParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/delete_o_auth2_client_responses.go b/internal/httpclient/client/admin/delete_o_auth2_client_responses.go index fb2869ba2d5..d67c98e741a 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/delete_o_auth2_client_responses.go @@ -29,20 +29,15 @@ func (o *DeleteOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return result, nil - case 404: - result := NewDeleteOAuth2ClientNotFound() + default: + result := NewDeleteOAuth2ClientDefault(response.Code()) if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } - return nil, result - case 500: - result := NewDeleteOAuth2ClientInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err + if response.Code()/100 == 2 { + return result, nil } return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -51,9 +46,9 @@ func NewDeleteOAuth2ClientNoContent() *DeleteOAuth2ClientNoContent { return &DeleteOAuth2ClientNoContent{} } -/* DeleteOAuth2ClientNoContent describes a response with status code 204, with default header values. +/*DeleteOAuth2ClientNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteOAuth2ClientNoContent struct { @@ -68,59 +63,37 @@ func (o *DeleteOAuth2ClientNoContent) readResponse(response runtime.ClientRespon return nil } -// NewDeleteOAuth2ClientNotFound creates a DeleteOAuth2ClientNotFound with default headers values -func NewDeleteOAuth2ClientNotFound() *DeleteOAuth2ClientNotFound { - return &DeleteOAuth2ClientNotFound{} +// NewDeleteOAuth2ClientDefault creates a DeleteOAuth2ClientDefault with default headers values +func NewDeleteOAuth2ClientDefault(code int) *DeleteOAuth2ClientDefault { + return &DeleteOAuth2ClientDefault{ + _statusCode: code, + } } -/* DeleteOAuth2ClientNotFound describes a response with status code 404, with default header values. +/*DeleteOAuth2ClientDefault handles this case with default header values. jsonError */ -type DeleteOAuth2ClientNotFound struct { - Payload *models.JSONError -} +type DeleteOAuth2ClientDefault struct { + _statusCode int -func (o *DeleteOAuth2ClientNotFound) Error() string { - return fmt.Sprintf("[DELETE /clients/{id}][%d] deleteOAuth2ClientNotFound %+v", 404, o.Payload) -} -func (o *DeleteOAuth2ClientNotFound) GetPayload() *models.JSONError { - return o.Payload -} - -func (o *DeleteOAuth2ClientNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JSONError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil + Payload *models.JSONError } -// NewDeleteOAuth2ClientInternalServerError creates a DeleteOAuth2ClientInternalServerError with default headers values -func NewDeleteOAuth2ClientInternalServerError() *DeleteOAuth2ClientInternalServerError { - return &DeleteOAuth2ClientInternalServerError{} +// Code gets the status code for the delete o auth2 client default response +func (o *DeleteOAuth2ClientDefault) Code() int { + return o._statusCode } -/* DeleteOAuth2ClientInternalServerError describes a response with status code 500, with default header values. - -jsonError -*/ -type DeleteOAuth2ClientInternalServerError struct { - Payload *models.JSONError +func (o *DeleteOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[DELETE /clients/{id}][%d] deleteOAuth2Client default %+v", o._statusCode, o.Payload) } -func (o *DeleteOAuth2ClientInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /clients/{id}][%d] deleteOAuth2ClientInternalServerError %+v", 500, o.Payload) -} -func (o *DeleteOAuth2ClientInternalServerError) GetPayload() *models.JSONError { +func (o *DeleteOAuth2ClientDefault) GetPayload() *models.JSONError { return o.Payload } -func (o *DeleteOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DeleteOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.JSONError) diff --git a/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go b/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go index 683579f246a..ae926e1d885 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go +++ b/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteOAuth2TokenParams creates a new DeleteOAuth2TokenParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDeleteOAuth2TokenParams creates a new DeleteOAuth2TokenParams object +// with the default values initialized. func NewDeleteOAuth2TokenParams() *DeleteOAuth2TokenParams { + var () return &DeleteOAuth2TokenParams{ + timeout: cr.DefaultTimeout, } } // NewDeleteOAuth2TokenParamsWithTimeout creates a new DeleteOAuth2TokenParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDeleteOAuth2TokenParamsWithTimeout(timeout time.Duration) *DeleteOAuth2TokenParams { + var () return &DeleteOAuth2TokenParams{ + timeout: timeout, } } // NewDeleteOAuth2TokenParamsWithContext creates a new DeleteOAuth2TokenParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDeleteOAuth2TokenParamsWithContext(ctx context.Context) *DeleteOAuth2TokenParams { + var () return &DeleteOAuth2TokenParams{ + Context: ctx, } } // NewDeleteOAuth2TokenParamsWithHTTPClient creates a new DeleteOAuth2TokenParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDeleteOAuth2TokenParamsWithHTTPClient(client *http.Client) *DeleteOAuth2TokenParams { + var () return &DeleteOAuth2TokenParams{ HTTPClient: client, } } -/* DeleteOAuth2TokenParams contains all the parameters to send to the API endpoint - for the delete o auth2 token operation. - - Typically these are written to a http.Request. +/*DeleteOAuth2TokenParams contains all the parameters to send to the API endpoint +for the delete o auth2 token operation typically these are written to a http.Request */ type DeleteOAuth2TokenParams struct { - // ClientID. + /*ClientID*/ ClientID string timeout time.Duration @@ -67,21 +68,6 @@ type DeleteOAuth2TokenParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the delete o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteOAuth2TokenParams) WithDefaults() *DeleteOAuth2TokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteOAuth2TokenParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the delete o auth2 token params func (o *DeleteOAuth2TokenParams) WithTimeout(timeout time.Duration) *DeleteOAuth2TokenParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *DeleteOAuth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg st qrClientID := o.ClientID qClientID := qrClientID if qClientID != "" { - if err := r.SetQueryParam("client_id", qClientID); err != nil { return err } diff --git a/internal/httpclient/client/admin/delete_o_auth2_token_responses.go b/internal/httpclient/client/admin/delete_o_auth2_token_responses.go index 91bce5c7128..cfbc62304a6 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_token_responses.go +++ b/internal/httpclient/client/admin/delete_o_auth2_token_responses.go @@ -41,8 +41,9 @@ func (o *DeleteOAuth2TokenReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewDeleteOAuth2TokenNoContent() *DeleteOAuth2TokenNoContent { return &DeleteOAuth2TokenNoContent{} } -/* DeleteOAuth2TokenNoContent describes a response with status code 204, with default header values. +/*DeleteOAuth2TokenNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteOAuth2TokenNoContent struct { @@ -73,7 +74,7 @@ func NewDeleteOAuth2TokenUnauthorized() *DeleteOAuth2TokenUnauthorized { return &DeleteOAuth2TokenUnauthorized{} } -/* DeleteOAuth2TokenUnauthorized describes a response with status code 401, with default header values. +/*DeleteOAuth2TokenUnauthorized handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type DeleteOAuth2TokenUnauthorized struct { func (o *DeleteOAuth2TokenUnauthorized) Error() string { return fmt.Sprintf("[DELETE /oauth2/tokens][%d] deleteOAuth2TokenUnauthorized %+v", 401, o.Payload) } + func (o *DeleteOAuth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewDeleteOAuth2TokenInternalServerError() *DeleteOAuth2TokenInternalServerE return &DeleteOAuth2TokenInternalServerError{} } -/* DeleteOAuth2TokenInternalServerError describes a response with status code 500, with default header values. +/*DeleteOAuth2TokenInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type DeleteOAuth2TokenInternalServerError struct { func (o *DeleteOAuth2TokenInternalServerError) Error() string { return fmt.Sprintf("[DELETE /oauth2/tokens][%d] deleteOAuth2TokenInternalServerError %+v", 500, o.Payload) } + func (o *DeleteOAuth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/flush_inactive_jwt_bearer_grants_parameters.go b/internal/httpclient/client/admin/flush_inactive_jwt_bearer_grants_parameters.go deleted file mode 100644 index f2e1a202f50..00000000000 --- a/internal/httpclient/client/admin/flush_inactive_jwt_bearer_grants_parameters.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// NewFlushInactiveJwtBearerGrantsParams creates a new FlushInactiveJwtBearerGrantsParams object -// with the default values initialized. -func NewFlushInactiveJwtBearerGrantsParams() *FlushInactiveJwtBearerGrantsParams { - var () - return &FlushInactiveJwtBearerGrantsParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewFlushInactiveJwtBearerGrantsParamsWithTimeout creates a new FlushInactiveJwtBearerGrantsParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewFlushInactiveJwtBearerGrantsParamsWithTimeout(timeout time.Duration) *FlushInactiveJwtBearerGrantsParams { - var () - return &FlushInactiveJwtBearerGrantsParams{ - - timeout: timeout, - } -} - -// NewFlushInactiveJwtBearerGrantsParamsWithContext creates a new FlushInactiveJwtBearerGrantsParams object -// with the default values initialized, and the ability to set a context for a request -func NewFlushInactiveJwtBearerGrantsParamsWithContext(ctx context.Context) *FlushInactiveJwtBearerGrantsParams { - var () - return &FlushInactiveJwtBearerGrantsParams{ - - Context: ctx, - } -} - -// NewFlushInactiveJwtBearerGrantsParamsWithHTTPClient creates a new FlushInactiveJwtBearerGrantsParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewFlushInactiveJwtBearerGrantsParamsWithHTTPClient(client *http.Client) *FlushInactiveJwtBearerGrantsParams { - var () - return &FlushInactiveJwtBearerGrantsParams{ - HTTPClient: client, - } -} - -/*FlushInactiveJwtBearerGrantsParams contains all the parameters to send to the API endpoint -for the flush inactive jwt bearer grants operation typically these are written to a http.Request -*/ -type FlushInactiveJwtBearerGrantsParams struct { - - /*Body*/ - Body *models.FlushInactiveJwtBearerGrantsParams - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the flush inactive jwt bearer grants params -func (o *FlushInactiveJwtBearerGrantsParams) WithTimeout(timeout time.Duration) *FlushInactiveJwtBearerGrantsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the flush inactive jwt bearer grants params -func (o *FlushInactiveJwtBearerGrantsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the flush inactive jwt bearer grants params -func (o *FlushInactiveJwtBearerGrantsParams) WithContext(ctx context.Context) *FlushInactiveJwtBearerGrantsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the flush inactive jwt bearer grants params -func (o *FlushInactiveJwtBearerGrantsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the flush inactive jwt bearer grants params -func (o *FlushInactiveJwtBearerGrantsParams) WithHTTPClient(client *http.Client) *FlushInactiveJwtBearerGrantsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the flush inactive jwt bearer grants params -func (o *FlushInactiveJwtBearerGrantsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the flush inactive jwt bearer grants params -func (o *FlushInactiveJwtBearerGrantsParams) WithBody(body *models.FlushInactiveJwtBearerGrantsParams) *FlushInactiveJwtBearerGrantsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the flush inactive jwt bearer grants params -func (o *FlushInactiveJwtBearerGrantsParams) SetBody(body *models.FlushInactiveJwtBearerGrantsParams) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *FlushInactiveJwtBearerGrantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/admin/flush_inactive_jwt_bearer_grants_responses.go b/internal/httpclient/client/admin/flush_inactive_jwt_bearer_grants_responses.go deleted file mode 100644 index 2fce8d47424..00000000000 --- a/internal/httpclient/client/admin/flush_inactive_jwt_bearer_grants_responses.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// FlushInactiveJwtBearerGrantsReader is a Reader for the FlushInactiveJwtBearerGrants structure. -type FlushInactiveJwtBearerGrantsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *FlushInactiveJwtBearerGrantsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewFlushInactiveJwtBearerGrantsNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewFlushInactiveJwtBearerGrantsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewFlushInactiveJwtBearerGrantsNoContent creates a FlushInactiveJwtBearerGrantsNoContent with default headers values -func NewFlushInactiveJwtBearerGrantsNoContent() *FlushInactiveJwtBearerGrantsNoContent { - return &FlushInactiveJwtBearerGrantsNoContent{} -} - -/*FlushInactiveJwtBearerGrantsNoContent handles this case with default header values. - -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201. -*/ -type FlushInactiveJwtBearerGrantsNoContent struct { -} - -func (o *FlushInactiveJwtBearerGrantsNoContent) Error() string { - return fmt.Sprintf("[POST /grants/jwt-bearer/flush][%d] flushInactiveJwtBearerGrantsNoContent ", 204) -} - -func (o *FlushInactiveJwtBearerGrantsNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewFlushInactiveJwtBearerGrantsInternalServerError creates a FlushInactiveJwtBearerGrantsInternalServerError with default headers values -func NewFlushInactiveJwtBearerGrantsInternalServerError() *FlushInactiveJwtBearerGrantsInternalServerError { - return &FlushInactiveJwtBearerGrantsInternalServerError{} -} - -/*FlushInactiveJwtBearerGrantsInternalServerError handles this case with default header values. - -genericError -*/ -type FlushInactiveJwtBearerGrantsInternalServerError struct { - Payload *models.GenericError -} - -func (o *FlushInactiveJwtBearerGrantsInternalServerError) Error() string { - return fmt.Sprintf("[POST /grants/jwt-bearer/flush][%d] flushInactiveJwtBearerGrantsInternalServerError %+v", 500, o.Payload) -} - -func (o *FlushInactiveJwtBearerGrantsInternalServerError) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *FlushInactiveJwtBearerGrantsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go index ae82bc9c891..619a282d2bd 100644 --- a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go +++ b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go @@ -18,50 +18,51 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewFlushInactiveOAuth2TokensParams creates a new FlushInactiveOAuth2TokensParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewFlushInactiveOAuth2TokensParams creates a new FlushInactiveOAuth2TokensParams object +// with the default values initialized. func NewFlushInactiveOAuth2TokensParams() *FlushInactiveOAuth2TokensParams { + var () return &FlushInactiveOAuth2TokensParams{ + timeout: cr.DefaultTimeout, } } // NewFlushInactiveOAuth2TokensParamsWithTimeout creates a new FlushInactiveOAuth2TokensParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewFlushInactiveOAuth2TokensParamsWithTimeout(timeout time.Duration) *FlushInactiveOAuth2TokensParams { + var () return &FlushInactiveOAuth2TokensParams{ + timeout: timeout, } } // NewFlushInactiveOAuth2TokensParamsWithContext creates a new FlushInactiveOAuth2TokensParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewFlushInactiveOAuth2TokensParamsWithContext(ctx context.Context) *FlushInactiveOAuth2TokensParams { + var () return &FlushInactiveOAuth2TokensParams{ + Context: ctx, } } // NewFlushInactiveOAuth2TokensParamsWithHTTPClient creates a new FlushInactiveOAuth2TokensParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewFlushInactiveOAuth2TokensParamsWithHTTPClient(client *http.Client) *FlushInactiveOAuth2TokensParams { + var () return &FlushInactiveOAuth2TokensParams{ HTTPClient: client, } } -/* FlushInactiveOAuth2TokensParams contains all the parameters to send to the API endpoint - for the flush inactive o auth2 tokens operation. - - Typically these are written to a http.Request. +/*FlushInactiveOAuth2TokensParams contains all the parameters to send to the API endpoint +for the flush inactive o auth2 tokens operation typically these are written to a http.Request */ type FlushInactiveOAuth2TokensParams struct { - // Body. + /*Body*/ Body *models.FlushInactiveOAuth2TokensRequest timeout time.Duration @@ -69,21 +70,6 @@ type FlushInactiveOAuth2TokensParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the flush inactive o auth2 tokens params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *FlushInactiveOAuth2TokensParams) WithDefaults() *FlushInactiveOAuth2TokensParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the flush inactive o auth2 tokens params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *FlushInactiveOAuth2TokensParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the flush inactive o auth2 tokens params func (o *FlushInactiveOAuth2TokensParams) WithTimeout(timeout time.Duration) *FlushInactiveOAuth2TokensParams { o.SetTimeout(timeout) @@ -135,6 +121,7 @@ func (o *FlushInactiveOAuth2TokensParams) WriteToRequest(r runtime.ClientRequest return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go index 7632e44e2ce..242ee437e59 100644 --- a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go +++ b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go @@ -41,8 +41,9 @@ func (o *FlushInactiveOAuth2TokensReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewFlushInactiveOAuth2TokensNoContent() *FlushInactiveOAuth2TokensNoContent return &FlushInactiveOAuth2TokensNoContent{} } -/* FlushInactiveOAuth2TokensNoContent describes a response with status code 204, with default header values. +/*FlushInactiveOAuth2TokensNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type FlushInactiveOAuth2TokensNoContent struct { @@ -73,7 +74,7 @@ func NewFlushInactiveOAuth2TokensUnauthorized() *FlushInactiveOAuth2TokensUnauth return &FlushInactiveOAuth2TokensUnauthorized{} } -/* FlushInactiveOAuth2TokensUnauthorized describes a response with status code 401, with default header values. +/*FlushInactiveOAuth2TokensUnauthorized handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type FlushInactiveOAuth2TokensUnauthorized struct { func (o *FlushInactiveOAuth2TokensUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/flush][%d] flushInactiveOAuth2TokensUnauthorized %+v", 401, o.Payload) } + func (o *FlushInactiveOAuth2TokensUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewFlushInactiveOAuth2TokensInternalServerError() *FlushInactiveOAuth2Token return &FlushInactiveOAuth2TokensInternalServerError{} } -/* FlushInactiveOAuth2TokensInternalServerError describes a response with status code 500, with default header values. +/*FlushInactiveOAuth2TokensInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type FlushInactiveOAuth2TokensInternalServerError struct { func (o *FlushInactiveOAuth2TokensInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/flush][%d] flushInactiveOAuth2TokensInternalServerError %+v", 500, o.Payload) } + func (o *FlushInactiveOAuth2TokensInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_consent_request_parameters.go b/internal/httpclient/client/admin/get_consent_request_parameters.go index 3cdba97c4a1..76033747908 100644 --- a/internal/httpclient/client/admin/get_consent_request_parameters.go +++ b/internal/httpclient/client/admin/get_consent_request_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetConsentRequestParams creates a new GetConsentRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetConsentRequestParams creates a new GetConsentRequestParams object +// with the default values initialized. func NewGetConsentRequestParams() *GetConsentRequestParams { + var () return &GetConsentRequestParams{ + timeout: cr.DefaultTimeout, } } // NewGetConsentRequestParamsWithTimeout creates a new GetConsentRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetConsentRequestParamsWithTimeout(timeout time.Duration) *GetConsentRequestParams { + var () return &GetConsentRequestParams{ + timeout: timeout, } } // NewGetConsentRequestParamsWithContext creates a new GetConsentRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetConsentRequestParamsWithContext(ctx context.Context) *GetConsentRequestParams { + var () return &GetConsentRequestParams{ + Context: ctx, } } // NewGetConsentRequestParamsWithHTTPClient creates a new GetConsentRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetConsentRequestParamsWithHTTPClient(client *http.Client) *GetConsentRequestParams { + var () return &GetConsentRequestParams{ HTTPClient: client, } } -/* GetConsentRequestParams contains all the parameters to send to the API endpoint - for the get consent request operation. - - Typically these are written to a http.Request. +/*GetConsentRequestParams contains all the parameters to send to the API endpoint +for the get consent request operation typically these are written to a http.Request */ type GetConsentRequestParams struct { - // ConsentChallenge. + /*ConsentChallenge*/ ConsentChallenge string timeout time.Duration @@ -67,21 +68,6 @@ type GetConsentRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetConsentRequestParams) WithDefaults() *GetConsentRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetConsentRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get consent request params func (o *GetConsentRequestParams) WithTimeout(timeout time.Duration) *GetConsentRequestParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *GetConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg st qrConsentChallenge := o.ConsentChallenge qConsentChallenge := qrConsentChallenge if qConsentChallenge != "" { - if err := r.SetQueryParam("consent_challenge", qConsentChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/get_consent_request_responses.go b/internal/httpclient/client/admin/get_consent_request_responses.go index 6621dc5bd27..8a95208b137 100644 --- a/internal/httpclient/client/admin/get_consent_request_responses.go +++ b/internal/httpclient/client/admin/get_consent_request_responses.go @@ -47,8 +47,9 @@ func (o *GetConsentRequestReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewGetConsentRequestOK() *GetConsentRequestOK { return &GetConsentRequestOK{} } -/* GetConsentRequestOK describes a response with status code 200, with default header values. +/*GetConsentRequestOK handles this case with default header values. consentRequest */ @@ -68,6 +69,7 @@ type GetConsentRequestOK struct { func (o *GetConsentRequestOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestOK %+v", 200, o.Payload) } + func (o *GetConsentRequestOK) GetPayload() *models.ConsentRequest { return o.Payload } @@ -89,7 +91,7 @@ func NewGetConsentRequestNotFound() *GetConsentRequestNotFound { return &GetConsentRequestNotFound{} } -/* GetConsentRequestNotFound describes a response with status code 404, with default header values. +/*GetConsentRequestNotFound handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type GetConsentRequestNotFound struct { func (o *GetConsentRequestNotFound) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestNotFound %+v", 404, o.Payload) } + func (o *GetConsentRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewGetConsentRequestGone() *GetConsentRequestGone { return &GetConsentRequestGone{} } -/* GetConsentRequestGone describes a response with status code 410, with default header values. +/*GetConsentRequestGone handles this case with default header values. requestWasHandledResponse */ @@ -132,6 +135,7 @@ type GetConsentRequestGone struct { func (o *GetConsentRequestGone) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestGone %+v", 410, o.Payload) } + func (o *GetConsentRequestGone) GetPayload() *models.RequestWasHandledResponse { return o.Payload } @@ -153,7 +157,7 @@ func NewGetConsentRequestInternalServerError() *GetConsentRequestInternalServerE return &GetConsentRequestInternalServerError{} } -/* GetConsentRequestInternalServerError describes a response with status code 500, with default header values. +/*GetConsentRequestInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type GetConsentRequestInternalServerError struct { func (o *GetConsentRequestInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestInternalServerError %+v", 500, o.Payload) } + func (o *GetConsentRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_json_web_key_parameters.go b/internal/httpclient/client/admin/get_json_web_key_parameters.go index bf7429056e8..c8c609b8695 100644 --- a/internal/httpclient/client/admin/get_json_web_key_parameters.go +++ b/internal/httpclient/client/admin/get_json_web_key_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetJSONWebKeyParams creates a new GetJSONWebKeyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetJSONWebKeyParams creates a new GetJSONWebKeyParams object +// with the default values initialized. func NewGetJSONWebKeyParams() *GetJSONWebKeyParams { + var () return &GetJSONWebKeyParams{ + timeout: cr.DefaultTimeout, } } // NewGetJSONWebKeyParamsWithTimeout creates a new GetJSONWebKeyParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetJSONWebKeyParamsWithTimeout(timeout time.Duration) *GetJSONWebKeyParams { + var () return &GetJSONWebKeyParams{ + timeout: timeout, } } // NewGetJSONWebKeyParamsWithContext creates a new GetJSONWebKeyParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetJSONWebKeyParamsWithContext(ctx context.Context) *GetJSONWebKeyParams { + var () return &GetJSONWebKeyParams{ + Context: ctx, } } // NewGetJSONWebKeyParamsWithHTTPClient creates a new GetJSONWebKeyParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetJSONWebKeyParamsWithHTTPClient(client *http.Client) *GetJSONWebKeyParams { + var () return &GetJSONWebKeyParams{ HTTPClient: client, } } -/* GetJSONWebKeyParams contains all the parameters to send to the API endpoint - for the get Json web key operation. - - Typically these are written to a http.Request. +/*GetJSONWebKeyParams contains all the parameters to send to the API endpoint +for the get Json web key operation typically these are written to a http.Request */ type GetJSONWebKeyParams struct { - /* Kid. + /*Kid + The kid of the desired key - The kid of the desired key */ Kid string + /*Set + The set - /* Set. - - The set */ Set string @@ -76,21 +76,6 @@ type GetJSONWebKeyParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetJSONWebKeyParams) WithDefaults() *GetJSONWebKeyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetJSONWebKeyParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get Json web key params func (o *GetJSONWebKeyParams) WithTimeout(timeout time.Duration) *GetJSONWebKeyParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_json_web_key_responses.go b/internal/httpclient/client/admin/get_json_web_key_responses.go index 2a0c4c2e50d..16951135c77 100644 --- a/internal/httpclient/client/admin/get_json_web_key_responses.go +++ b/internal/httpclient/client/admin/get_json_web_key_responses.go @@ -41,8 +41,9 @@ func (o *GetJSONWebKeyReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewGetJSONWebKeyOK() *GetJSONWebKeyOK { return &GetJSONWebKeyOK{} } -/* GetJSONWebKeyOK describes a response with status code 200, with default header values. +/*GetJSONWebKeyOK handles this case with default header values. JSONWebKeySet */ @@ -62,6 +63,7 @@ type GetJSONWebKeyOK struct { func (o *GetJSONWebKeyOK) Error() string { return fmt.Sprintf("[GET /keys/{set}/{kid}][%d] getJsonWebKeyOK %+v", 200, o.Payload) } + func (o *GetJSONWebKeyOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -83,7 +85,7 @@ func NewGetJSONWebKeyNotFound() *GetJSONWebKeyNotFound { return &GetJSONWebKeyNotFound{} } -/* GetJSONWebKeyNotFound describes a response with status code 404, with default header values. +/*GetJSONWebKeyNotFound handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type GetJSONWebKeyNotFound struct { func (o *GetJSONWebKeyNotFound) Error() string { return fmt.Sprintf("[GET /keys/{set}/{kid}][%d] getJsonWebKeyNotFound %+v", 404, o.Payload) } + func (o *GetJSONWebKeyNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewGetJSONWebKeyInternalServerError() *GetJSONWebKeyInternalServerError { return &GetJSONWebKeyInternalServerError{} } -/* GetJSONWebKeyInternalServerError describes a response with status code 500, with default header values. +/*GetJSONWebKeyInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type GetJSONWebKeyInternalServerError struct { func (o *GetJSONWebKeyInternalServerError) Error() string { return fmt.Sprintf("[GET /keys/{set}/{kid}][%d] getJsonWebKeyInternalServerError %+v", 500, o.Payload) } + func (o *GetJSONWebKeyInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_json_web_key_set_parameters.go b/internal/httpclient/client/admin/get_json_web_key_set_parameters.go index 1635ddb667d..34dee113c0d 100644 --- a/internal/httpclient/client/admin/get_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/get_json_web_key_set_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetJSONWebKeySetParams creates a new GetJSONWebKeySetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetJSONWebKeySetParams creates a new GetJSONWebKeySetParams object +// with the default values initialized. func NewGetJSONWebKeySetParams() *GetJSONWebKeySetParams { + var () return &GetJSONWebKeySetParams{ + timeout: cr.DefaultTimeout, } } // NewGetJSONWebKeySetParamsWithTimeout creates a new GetJSONWebKeySetParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetJSONWebKeySetParamsWithTimeout(timeout time.Duration) *GetJSONWebKeySetParams { + var () return &GetJSONWebKeySetParams{ + timeout: timeout, } } // NewGetJSONWebKeySetParamsWithContext creates a new GetJSONWebKeySetParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetJSONWebKeySetParamsWithContext(ctx context.Context) *GetJSONWebKeySetParams { + var () return &GetJSONWebKeySetParams{ + Context: ctx, } } // NewGetJSONWebKeySetParamsWithHTTPClient creates a new GetJSONWebKeySetParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetJSONWebKeySetParamsWithHTTPClient(client *http.Client) *GetJSONWebKeySetParams { + var () return &GetJSONWebKeySetParams{ HTTPClient: client, } } -/* GetJSONWebKeySetParams contains all the parameters to send to the API endpoint - for the get Json web key set operation. - - Typically these are written to a http.Request. +/*GetJSONWebKeySetParams contains all the parameters to send to the API endpoint +for the get Json web key set operation typically these are written to a http.Request */ type GetJSONWebKeySetParams struct { - /* Set. + /*Set + The set - The set */ Set string @@ -70,21 +71,6 @@ type GetJSONWebKeySetParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetJSONWebKeySetParams) WithDefaults() *GetJSONWebKeySetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetJSONWebKeySetParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get Json web key set params func (o *GetJSONWebKeySetParams) WithTimeout(timeout time.Duration) *GetJSONWebKeySetParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_json_web_key_set_responses.go b/internal/httpclient/client/admin/get_json_web_key_set_responses.go index 071a09ee356..3c04c72704c 100644 --- a/internal/httpclient/client/admin/get_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/get_json_web_key_set_responses.go @@ -47,8 +47,9 @@ func (o *GetJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewGetJSONWebKeySetOK() *GetJSONWebKeySetOK { return &GetJSONWebKeySetOK{} } -/* GetJSONWebKeySetOK describes a response with status code 200, with default header values. +/*GetJSONWebKeySetOK handles this case with default header values. JSONWebKeySet */ @@ -68,6 +69,7 @@ type GetJSONWebKeySetOK struct { func (o *GetJSONWebKeySetOK) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetOK %+v", 200, o.Payload) } + func (o *GetJSONWebKeySetOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -89,7 +91,7 @@ func NewGetJSONWebKeySetUnauthorized() *GetJSONWebKeySetUnauthorized { return &GetJSONWebKeySetUnauthorized{} } -/* GetJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. +/*GetJSONWebKeySetUnauthorized handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type GetJSONWebKeySetUnauthorized struct { func (o *GetJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetUnauthorized %+v", 401, o.Payload) } + func (o *GetJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewGetJSONWebKeySetForbidden() *GetJSONWebKeySetForbidden { return &GetJSONWebKeySetForbidden{} } -/* GetJSONWebKeySetForbidden describes a response with status code 403, with default header values. +/*GetJSONWebKeySetForbidden handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type GetJSONWebKeySetForbidden struct { func (o *GetJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetForbidden %+v", 403, o.Payload) } + func (o *GetJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewGetJSONWebKeySetInternalServerError() *GetJSONWebKeySetInternalServerErr return &GetJSONWebKeySetInternalServerError{} } -/* GetJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. +/*GetJSONWebKeySetInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type GetJSONWebKeySetInternalServerError struct { func (o *GetJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetInternalServerError %+v", 500, o.Payload) } + func (o *GetJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_login_request_parameters.go b/internal/httpclient/client/admin/get_login_request_parameters.go index 55a3dae116f..32ce4b750f3 100644 --- a/internal/httpclient/client/admin/get_login_request_parameters.go +++ b/internal/httpclient/client/admin/get_login_request_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLoginRequestParams creates a new GetLoginRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetLoginRequestParams creates a new GetLoginRequestParams object +// with the default values initialized. func NewGetLoginRequestParams() *GetLoginRequestParams { + var () return &GetLoginRequestParams{ + timeout: cr.DefaultTimeout, } } // NewGetLoginRequestParamsWithTimeout creates a new GetLoginRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetLoginRequestParamsWithTimeout(timeout time.Duration) *GetLoginRequestParams { + var () return &GetLoginRequestParams{ + timeout: timeout, } } // NewGetLoginRequestParamsWithContext creates a new GetLoginRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetLoginRequestParamsWithContext(ctx context.Context) *GetLoginRequestParams { + var () return &GetLoginRequestParams{ + Context: ctx, } } // NewGetLoginRequestParamsWithHTTPClient creates a new GetLoginRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetLoginRequestParamsWithHTTPClient(client *http.Client) *GetLoginRequestParams { + var () return &GetLoginRequestParams{ HTTPClient: client, } } -/* GetLoginRequestParams contains all the parameters to send to the API endpoint - for the get login request operation. - - Typically these are written to a http.Request. +/*GetLoginRequestParams contains all the parameters to send to the API endpoint +for the get login request operation typically these are written to a http.Request */ type GetLoginRequestParams struct { - // LoginChallenge. + /*LoginChallenge*/ LoginChallenge string timeout time.Duration @@ -67,21 +68,6 @@ type GetLoginRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLoginRequestParams) WithDefaults() *GetLoginRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLoginRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get login request params func (o *GetLoginRequestParams) WithTimeout(timeout time.Duration) *GetLoginRequestParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *GetLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg strf qrLoginChallenge := o.LoginChallenge qLoginChallenge := qrLoginChallenge if qLoginChallenge != "" { - if err := r.SetQueryParam("login_challenge", qLoginChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/get_login_request_responses.go b/internal/httpclient/client/admin/get_login_request_responses.go index 4eaddfbf39f..57221a73d49 100644 --- a/internal/httpclient/client/admin/get_login_request_responses.go +++ b/internal/httpclient/client/admin/get_login_request_responses.go @@ -53,8 +53,9 @@ func (o *GetLoginRequestReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -63,7 +64,7 @@ func NewGetLoginRequestOK() *GetLoginRequestOK { return &GetLoginRequestOK{} } -/* GetLoginRequestOK describes a response with status code 200, with default header values. +/*GetLoginRequestOK handles this case with default header values. loginRequest */ @@ -74,6 +75,7 @@ type GetLoginRequestOK struct { func (o *GetLoginRequestOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestOK %+v", 200, o.Payload) } + func (o *GetLoginRequestOK) GetPayload() *models.LoginRequest { return o.Payload } @@ -95,7 +97,7 @@ func NewGetLoginRequestBadRequest() *GetLoginRequestBadRequest { return &GetLoginRequestBadRequest{} } -/* GetLoginRequestBadRequest describes a response with status code 400, with default header values. +/*GetLoginRequestBadRequest handles this case with default header values. jsonError */ @@ -106,6 +108,7 @@ type GetLoginRequestBadRequest struct { func (o *GetLoginRequestBadRequest) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestBadRequest %+v", 400, o.Payload) } + func (o *GetLoginRequestBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -127,7 +130,7 @@ func NewGetLoginRequestNotFound() *GetLoginRequestNotFound { return &GetLoginRequestNotFound{} } -/* GetLoginRequestNotFound describes a response with status code 404, with default header values. +/*GetLoginRequestNotFound handles this case with default header values. jsonError */ @@ -138,6 +141,7 @@ type GetLoginRequestNotFound struct { func (o *GetLoginRequestNotFound) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestNotFound %+v", 404, o.Payload) } + func (o *GetLoginRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -159,7 +163,7 @@ func NewGetLoginRequestGone() *GetLoginRequestGone { return &GetLoginRequestGone{} } -/* GetLoginRequestGone describes a response with status code 410, with default header values. +/*GetLoginRequestGone handles this case with default header values. requestWasHandledResponse */ @@ -170,6 +174,7 @@ type GetLoginRequestGone struct { func (o *GetLoginRequestGone) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestGone %+v", 410, o.Payload) } + func (o *GetLoginRequestGone) GetPayload() *models.RequestWasHandledResponse { return o.Payload } @@ -191,7 +196,7 @@ func NewGetLoginRequestInternalServerError() *GetLoginRequestInternalServerError return &GetLoginRequestInternalServerError{} } -/* GetLoginRequestInternalServerError describes a response with status code 500, with default header values. +/*GetLoginRequestInternalServerError handles this case with default header values. jsonError */ @@ -202,6 +207,7 @@ type GetLoginRequestInternalServerError struct { func (o *GetLoginRequestInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestInternalServerError %+v", 500, o.Payload) } + func (o *GetLoginRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_logout_request_parameters.go b/internal/httpclient/client/admin/get_logout_request_parameters.go index 97cf9f7e4bc..27ed8793be3 100644 --- a/internal/httpclient/client/admin/get_logout_request_parameters.go +++ b/internal/httpclient/client/admin/get_logout_request_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLogoutRequestParams creates a new GetLogoutRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetLogoutRequestParams creates a new GetLogoutRequestParams object +// with the default values initialized. func NewGetLogoutRequestParams() *GetLogoutRequestParams { + var () return &GetLogoutRequestParams{ + timeout: cr.DefaultTimeout, } } // NewGetLogoutRequestParamsWithTimeout creates a new GetLogoutRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetLogoutRequestParamsWithTimeout(timeout time.Duration) *GetLogoutRequestParams { + var () return &GetLogoutRequestParams{ + timeout: timeout, } } // NewGetLogoutRequestParamsWithContext creates a new GetLogoutRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetLogoutRequestParamsWithContext(ctx context.Context) *GetLogoutRequestParams { + var () return &GetLogoutRequestParams{ + Context: ctx, } } // NewGetLogoutRequestParamsWithHTTPClient creates a new GetLogoutRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetLogoutRequestParamsWithHTTPClient(client *http.Client) *GetLogoutRequestParams { + var () return &GetLogoutRequestParams{ HTTPClient: client, } } -/* GetLogoutRequestParams contains all the parameters to send to the API endpoint - for the get logout request operation. - - Typically these are written to a http.Request. +/*GetLogoutRequestParams contains all the parameters to send to the API endpoint +for the get logout request operation typically these are written to a http.Request */ type GetLogoutRequestParams struct { - // LogoutChallenge. + /*LogoutChallenge*/ LogoutChallenge string timeout time.Duration @@ -67,21 +68,6 @@ type GetLogoutRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLogoutRequestParams) WithDefaults() *GetLogoutRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLogoutRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get logout request params func (o *GetLogoutRequestParams) WithTimeout(timeout time.Duration) *GetLogoutRequestParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *GetLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg str qrLogoutChallenge := o.LogoutChallenge qLogoutChallenge := qrLogoutChallenge if qLogoutChallenge != "" { - if err := r.SetQueryParam("logout_challenge", qLogoutChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/get_logout_request_responses.go b/internal/httpclient/client/admin/get_logout_request_responses.go index 0b6448c101b..9d708a06795 100644 --- a/internal/httpclient/client/admin/get_logout_request_responses.go +++ b/internal/httpclient/client/admin/get_logout_request_responses.go @@ -47,8 +47,9 @@ func (o *GetLogoutRequestReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewGetLogoutRequestOK() *GetLogoutRequestOK { return &GetLogoutRequestOK{} } -/* GetLogoutRequestOK describes a response with status code 200, with default header values. +/*GetLogoutRequestOK handles this case with default header values. logoutRequest */ @@ -68,6 +69,7 @@ type GetLogoutRequestOK struct { func (o *GetLogoutRequestOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestOK %+v", 200, o.Payload) } + func (o *GetLogoutRequestOK) GetPayload() *models.LogoutRequest { return o.Payload } @@ -89,7 +91,7 @@ func NewGetLogoutRequestNotFound() *GetLogoutRequestNotFound { return &GetLogoutRequestNotFound{} } -/* GetLogoutRequestNotFound describes a response with status code 404, with default header values. +/*GetLogoutRequestNotFound handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type GetLogoutRequestNotFound struct { func (o *GetLogoutRequestNotFound) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestNotFound %+v", 404, o.Payload) } + func (o *GetLogoutRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewGetLogoutRequestGone() *GetLogoutRequestGone { return &GetLogoutRequestGone{} } -/* GetLogoutRequestGone describes a response with status code 410, with default header values. +/*GetLogoutRequestGone handles this case with default header values. requestWasHandledResponse */ @@ -132,6 +135,7 @@ type GetLogoutRequestGone struct { func (o *GetLogoutRequestGone) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestGone %+v", 410, o.Payload) } + func (o *GetLogoutRequestGone) GetPayload() *models.RequestWasHandledResponse { return o.Payload } @@ -153,7 +157,7 @@ func NewGetLogoutRequestInternalServerError() *GetLogoutRequestInternalServerErr return &GetLogoutRequestInternalServerError{} } -/* GetLogoutRequestInternalServerError describes a response with status code 500, with default header values. +/*GetLogoutRequestInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type GetLogoutRequestInternalServerError struct { func (o *GetLogoutRequestInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestInternalServerError %+v", 500, o.Payload) } + func (o *GetLogoutRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_o_auth2_client_parameters.go b/internal/httpclient/client/admin/get_o_auth2_client_parameters.go index f9af2c1f16f..ea7cb067357 100644 --- a/internal/httpclient/client/admin/get_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/get_o_auth2_client_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetOAuth2ClientParams creates a new GetOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetOAuth2ClientParams creates a new GetOAuth2ClientParams object +// with the default values initialized. func NewGetOAuth2ClientParams() *GetOAuth2ClientParams { + var () return &GetOAuth2ClientParams{ + timeout: cr.DefaultTimeout, } } // NewGetOAuth2ClientParamsWithTimeout creates a new GetOAuth2ClientParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetOAuth2ClientParamsWithTimeout(timeout time.Duration) *GetOAuth2ClientParams { + var () return &GetOAuth2ClientParams{ + timeout: timeout, } } // NewGetOAuth2ClientParamsWithContext creates a new GetOAuth2ClientParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetOAuth2ClientParamsWithContext(ctx context.Context) *GetOAuth2ClientParams { + var () return &GetOAuth2ClientParams{ + Context: ctx, } } // NewGetOAuth2ClientParamsWithHTTPClient creates a new GetOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetOAuth2ClientParamsWithHTTPClient(client *http.Client) *GetOAuth2ClientParams { + var () return &GetOAuth2ClientParams{ HTTPClient: client, } } -/* GetOAuth2ClientParams contains all the parameters to send to the API endpoint - for the get o auth2 client operation. - - Typically these are written to a http.Request. +/*GetOAuth2ClientParams contains all the parameters to send to the API endpoint +for the get o auth2 client operation typically these are written to a http.Request */ type GetOAuth2ClientParams struct { - /* ID. + /*ID + The id of the OAuth 2.0 Client. - The id of the OAuth 2.0 Client. */ ID string @@ -70,21 +71,6 @@ type GetOAuth2ClientParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetOAuth2ClientParams) WithDefaults() *GetOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get o auth2 client params func (o *GetOAuth2ClientParams) WithTimeout(timeout time.Duration) *GetOAuth2ClientParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_o_auth2_client_responses.go b/internal/httpclient/client/admin/get_o_auth2_client_responses.go index f00e4038c4d..f1a8ea63c80 100644 --- a/internal/httpclient/client/admin/get_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/get_o_auth2_client_responses.go @@ -29,20 +29,15 @@ func (o *GetOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return result, nil - case 401: - result := NewGetOAuth2ClientUnauthorized() + default: + result := NewGetOAuth2ClientDefault(response.Code()) if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } - return nil, result - case 500: - result := NewGetOAuth2ClientInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err + if response.Code()/100 == 2 { + return result, nil } return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -51,7 +46,7 @@ func NewGetOAuth2ClientOK() *GetOAuth2ClientOK { return &GetOAuth2ClientOK{} } -/* GetOAuth2ClientOK describes a response with status code 200, with default header values. +/*GetOAuth2ClientOK handles this case with default header values. oAuth2Client */ @@ -62,6 +57,7 @@ type GetOAuth2ClientOK struct { func (o *GetOAuth2ClientOK) Error() string { return fmt.Sprintf("[GET /clients/{id}][%d] getOAuth2ClientOK %+v", 200, o.Payload) } + func (o *GetOAuth2ClientOK) GetPayload() *models.OAuth2Client { return o.Payload } @@ -78,59 +74,37 @@ func (o *GetOAuth2ClientOK) readResponse(response runtime.ClientResponse, consum return nil } -// NewGetOAuth2ClientUnauthorized creates a GetOAuth2ClientUnauthorized with default headers values -func NewGetOAuth2ClientUnauthorized() *GetOAuth2ClientUnauthorized { - return &GetOAuth2ClientUnauthorized{} +// NewGetOAuth2ClientDefault creates a GetOAuth2ClientDefault with default headers values +func NewGetOAuth2ClientDefault(code int) *GetOAuth2ClientDefault { + return &GetOAuth2ClientDefault{ + _statusCode: code, + } } -/* GetOAuth2ClientUnauthorized describes a response with status code 401, with default header values. +/*GetOAuth2ClientDefault handles this case with default header values. jsonError */ -type GetOAuth2ClientUnauthorized struct { - Payload *models.JSONError -} - -func (o *GetOAuth2ClientUnauthorized) Error() string { - return fmt.Sprintf("[GET /clients/{id}][%d] getOAuth2ClientUnauthorized %+v", 401, o.Payload) -} -func (o *GetOAuth2ClientUnauthorized) GetPayload() *models.JSONError { - return o.Payload -} - -func (o *GetOAuth2ClientUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +type GetOAuth2ClientDefault struct { + _statusCode int - o.Payload = new(models.JSONError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil + Payload *models.JSONError } -// NewGetOAuth2ClientInternalServerError creates a GetOAuth2ClientInternalServerError with default headers values -func NewGetOAuth2ClientInternalServerError() *GetOAuth2ClientInternalServerError { - return &GetOAuth2ClientInternalServerError{} +// Code gets the status code for the get o auth2 client default response +func (o *GetOAuth2ClientDefault) Code() int { + return o._statusCode } -/* GetOAuth2ClientInternalServerError describes a response with status code 500, with default header values. - -jsonError -*/ -type GetOAuth2ClientInternalServerError struct { - Payload *models.JSONError +func (o *GetOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[GET /clients/{id}][%d] getOAuth2Client default %+v", o._statusCode, o.Payload) } -func (o *GetOAuth2ClientInternalServerError) Error() string { - return fmt.Sprintf("[GET /clients/{id}][%d] getOAuth2ClientInternalServerError %+v", 500, o.Payload) -} -func (o *GetOAuth2ClientInternalServerError) GetPayload() *models.JSONError { +func (o *GetOAuth2ClientDefault) GetPayload() *models.JSONError { return o.Payload } -func (o *GetOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *GetOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.JSONError) diff --git a/internal/httpclient/client/admin/get_version_parameters.go b/internal/httpclient/client/admin/get_version_parameters.go index 56746becb66..24417d3a303 100644 --- a/internal/httpclient/client/admin/get_version_parameters.go +++ b/internal/httpclient/client/admin/get_version_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVersionParams creates a new GetVersionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetVersionParams creates a new GetVersionParams object +// with the default values initialized. func NewGetVersionParams() *GetVersionParams { + return &GetVersionParams{ + timeout: cr.DefaultTimeout, } } // NewGetVersionParamsWithTimeout creates a new GetVersionParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetVersionParamsWithTimeout(timeout time.Duration) *GetVersionParams { + return &GetVersionParams{ + timeout: timeout, } } // NewGetVersionParamsWithContext creates a new GetVersionParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetVersionParamsWithContext(ctx context.Context) *GetVersionParams { + return &GetVersionParams{ + Context: ctx, } } // NewGetVersionParamsWithHTTPClient creates a new GetVersionParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetVersionParamsWithHTTPClient(client *http.Client) *GetVersionParams { + return &GetVersionParams{ HTTPClient: client, } } -/* GetVersionParams contains all the parameters to send to the API endpoint - for the get version operation. - - Typically these are written to a http.Request. +/*GetVersionParams contains all the parameters to send to the API endpoint +for the get version operation typically these are written to a http.Request */ type GetVersionParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type GetVersionParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetVersionParams) WithDefaults() *GetVersionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetVersionParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get version params func (o *GetVersionParams) WithTimeout(timeout time.Duration) *GetVersionParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_version_responses.go b/internal/httpclient/client/admin/get_version_responses.go index 55510cd6c00..1755c1707da 100644 --- a/internal/httpclient/client/admin/get_version_responses.go +++ b/internal/httpclient/client/admin/get_version_responses.go @@ -29,8 +29,9 @@ func (o *GetVersionReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return result, nil + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -39,7 +40,7 @@ func NewGetVersionOK() *GetVersionOK { return &GetVersionOK{} } -/* GetVersionOK describes a response with status code 200, with default header values. +/*GetVersionOK handles this case with default header values. version */ @@ -50,6 +51,7 @@ type GetVersionOK struct { func (o *GetVersionOK) Error() string { return fmt.Sprintf("[GET /version][%d] getVersionOK %+v", 200, o.Payload) } + func (o *GetVersionOK) GetPayload() *models.Version { return o.Payload } diff --git a/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go b/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go index c1addcfac03..3913438d85d 100644 --- a/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go +++ b/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go @@ -16,62 +16,62 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIntrospectOAuth2TokenParams creates a new IntrospectOAuth2TokenParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewIntrospectOAuth2TokenParams creates a new IntrospectOAuth2TokenParams object +// with the default values initialized. func NewIntrospectOAuth2TokenParams() *IntrospectOAuth2TokenParams { + var () return &IntrospectOAuth2TokenParams{ + timeout: cr.DefaultTimeout, } } // NewIntrospectOAuth2TokenParamsWithTimeout creates a new IntrospectOAuth2TokenParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewIntrospectOAuth2TokenParamsWithTimeout(timeout time.Duration) *IntrospectOAuth2TokenParams { + var () return &IntrospectOAuth2TokenParams{ + timeout: timeout, } } // NewIntrospectOAuth2TokenParamsWithContext creates a new IntrospectOAuth2TokenParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewIntrospectOAuth2TokenParamsWithContext(ctx context.Context) *IntrospectOAuth2TokenParams { + var () return &IntrospectOAuth2TokenParams{ + Context: ctx, } } // NewIntrospectOAuth2TokenParamsWithHTTPClient creates a new IntrospectOAuth2TokenParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewIntrospectOAuth2TokenParamsWithHTTPClient(client *http.Client) *IntrospectOAuth2TokenParams { + var () return &IntrospectOAuth2TokenParams{ HTTPClient: client, } } -/* IntrospectOAuth2TokenParams contains all the parameters to send to the API endpoint - for the introspect o auth2 token operation. - - Typically these are written to a http.Request. +/*IntrospectOAuth2TokenParams contains all the parameters to send to the API endpoint +for the introspect o auth2 token operation typically these are written to a http.Request */ type IntrospectOAuth2TokenParams struct { - /* Scope. - - An optional, space separated list of required scopes. If the access token was not granted one of the + /*Scope + An optional, space separated list of required scopes. If the access token was not granted one of the scopes, the result of active will be false. + */ Scope *string - - /* Token. - - The string value of the token. For access tokens, this + /*Token + The string value of the token. For access tokens, this is the "access_token" value returned from the token endpoint defined in OAuth 2.0. For refresh tokens, this is the "refresh_token" value returned. + */ Token string @@ -80,21 +80,6 @@ type IntrospectOAuth2TokenParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the introspect o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IntrospectOAuth2TokenParams) WithDefaults() *IntrospectOAuth2TokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the introspect o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IntrospectOAuth2TokenParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the introspect o auth2 token params func (o *IntrospectOAuth2TokenParams) WithTimeout(timeout time.Duration) *IntrospectOAuth2TokenParams { o.SetTimeout(timeout) @@ -171,6 +156,7 @@ func (o *IntrospectOAuth2TokenParams) WriteToRequest(r runtime.ClientRequest, re return err } } + } // form param token diff --git a/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go b/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go index 8ea409176f7..5dff4abf68e 100644 --- a/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go +++ b/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go @@ -41,8 +41,9 @@ func (o *IntrospectOAuth2TokenReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewIntrospectOAuth2TokenOK() *IntrospectOAuth2TokenOK { return &IntrospectOAuth2TokenOK{} } -/* IntrospectOAuth2TokenOK describes a response with status code 200, with default header values. +/*IntrospectOAuth2TokenOK handles this case with default header values. oAuth2TokenIntrospection */ @@ -62,6 +63,7 @@ type IntrospectOAuth2TokenOK struct { func (o *IntrospectOAuth2TokenOK) Error() string { return fmt.Sprintf("[POST /oauth2/introspect][%d] introspectOAuth2TokenOK %+v", 200, o.Payload) } + func (o *IntrospectOAuth2TokenOK) GetPayload() *models.OAuth2TokenIntrospection { return o.Payload } @@ -83,7 +85,7 @@ func NewIntrospectOAuth2TokenUnauthorized() *IntrospectOAuth2TokenUnauthorized { return &IntrospectOAuth2TokenUnauthorized{} } -/* IntrospectOAuth2TokenUnauthorized describes a response with status code 401, with default header values. +/*IntrospectOAuth2TokenUnauthorized handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type IntrospectOAuth2TokenUnauthorized struct { func (o *IntrospectOAuth2TokenUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/introspect][%d] introspectOAuth2TokenUnauthorized %+v", 401, o.Payload) } + func (o *IntrospectOAuth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewIntrospectOAuth2TokenInternalServerError() *IntrospectOAuth2TokenInterna return &IntrospectOAuth2TokenInternalServerError{} } -/* IntrospectOAuth2TokenInternalServerError describes a response with status code 500, with default header values. +/*IntrospectOAuth2TokenInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type IntrospectOAuth2TokenInternalServerError struct { func (o *IntrospectOAuth2TokenInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/introspect][%d] introspectOAuth2TokenInternalServerError %+v", 500, o.Payload) } + func (o *IntrospectOAuth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/is_instance_alive_parameters.go b/internal/httpclient/client/admin/is_instance_alive_parameters.go index 50766f53d7e..44c9c204fe3 100644 --- a/internal/httpclient/client/admin/is_instance_alive_parameters.go +++ b/internal/httpclient/client/admin/is_instance_alive_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIsInstanceAliveParams creates a new IsInstanceAliveParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewIsInstanceAliveParams creates a new IsInstanceAliveParams object +// with the default values initialized. func NewIsInstanceAliveParams() *IsInstanceAliveParams { + return &IsInstanceAliveParams{ + timeout: cr.DefaultTimeout, } } // NewIsInstanceAliveParamsWithTimeout creates a new IsInstanceAliveParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewIsInstanceAliveParamsWithTimeout(timeout time.Duration) *IsInstanceAliveParams { + return &IsInstanceAliveParams{ + timeout: timeout, } } // NewIsInstanceAliveParamsWithContext creates a new IsInstanceAliveParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewIsInstanceAliveParamsWithContext(ctx context.Context) *IsInstanceAliveParams { + return &IsInstanceAliveParams{ + Context: ctx, } } // NewIsInstanceAliveParamsWithHTTPClient creates a new IsInstanceAliveParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewIsInstanceAliveParamsWithHTTPClient(client *http.Client) *IsInstanceAliveParams { + return &IsInstanceAliveParams{ HTTPClient: client, } } -/* IsInstanceAliveParams contains all the parameters to send to the API endpoint - for the is instance alive operation. - - Typically these are written to a http.Request. +/*IsInstanceAliveParams contains all the parameters to send to the API endpoint +for the is instance alive operation typically these are written to a http.Request */ type IsInstanceAliveParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type IsInstanceAliveParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the is instance alive params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceAliveParams) WithDefaults() *IsInstanceAliveParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the is instance alive params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceAliveParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the is instance alive params func (o *IsInstanceAliveParams) WithTimeout(timeout time.Duration) *IsInstanceAliveParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/is_instance_alive_responses.go b/internal/httpclient/client/admin/is_instance_alive_responses.go index fd1036d01fb..ddf10ab1b45 100644 --- a/internal/httpclient/client/admin/is_instance_alive_responses.go +++ b/internal/httpclient/client/admin/is_instance_alive_responses.go @@ -35,8 +35,9 @@ func (o *IsInstanceAliveReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewIsInstanceAliveOK() *IsInstanceAliveOK { return &IsInstanceAliveOK{} } -/* IsInstanceAliveOK describes a response with status code 200, with default header values. +/*IsInstanceAliveOK handles this case with default header values. healthStatus */ @@ -56,6 +57,7 @@ type IsInstanceAliveOK struct { func (o *IsInstanceAliveOK) Error() string { return fmt.Sprintf("[GET /health/alive][%d] isInstanceAliveOK %+v", 200, o.Payload) } + func (o *IsInstanceAliveOK) GetPayload() *models.HealthStatus { return o.Payload } @@ -77,7 +79,7 @@ func NewIsInstanceAliveInternalServerError() *IsInstanceAliveInternalServerError return &IsInstanceAliveInternalServerError{} } -/* IsInstanceAliveInternalServerError describes a response with status code 500, with default header values. +/*IsInstanceAliveInternalServerError handles this case with default header values. jsonError */ @@ -88,6 +90,7 @@ type IsInstanceAliveInternalServerError struct { func (o *IsInstanceAliveInternalServerError) Error() string { return fmt.Sprintf("[GET /health/alive][%d] isInstanceAliveInternalServerError %+v", 500, o.Payload) } + func (o *IsInstanceAliveInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/list_o_auth2_clients_responses.go b/internal/httpclient/client/admin/list_o_auth2_clients_responses.go index aaeeb264335..5e7d00311c5 100644 --- a/internal/httpclient/client/admin/list_o_auth2_clients_responses.go +++ b/internal/httpclient/client/admin/list_o_auth2_clients_responses.go @@ -29,14 +29,15 @@ func (o *ListOAuth2ClientsReader) ReadResponse(response runtime.ClientResponse, return nil, err } return result, nil - case 500: - result := NewListOAuth2ClientsInternalServerError() + default: + result := NewListOAuth2ClientsDefault(response.Code()) if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } + if response.Code()/100 == 2 { + return result, nil + } return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewListOAuth2ClientsOK() *ListOAuth2ClientsOK { return &ListOAuth2ClientsOK{} } -/* ListOAuth2ClientsOK describes a response with status code 200, with default header values. +/*ListOAuth2ClientsOK handles this case with default header values. A list of clients. */ @@ -56,6 +57,7 @@ type ListOAuth2ClientsOK struct { func (o *ListOAuth2ClientsOK) Error() string { return fmt.Sprintf("[GET /clients][%d] listOAuth2ClientsOK %+v", 200, o.Payload) } + func (o *ListOAuth2ClientsOK) GetPayload() []*models.OAuth2Client { return o.Payload } @@ -70,27 +72,37 @@ func (o *ListOAuth2ClientsOK) readResponse(response runtime.ClientResponse, cons return nil } -// NewListOAuth2ClientsInternalServerError creates a ListOAuth2ClientsInternalServerError with default headers values -func NewListOAuth2ClientsInternalServerError() *ListOAuth2ClientsInternalServerError { - return &ListOAuth2ClientsInternalServerError{} +// NewListOAuth2ClientsDefault creates a ListOAuth2ClientsDefault with default headers values +func NewListOAuth2ClientsDefault(code int) *ListOAuth2ClientsDefault { + return &ListOAuth2ClientsDefault{ + _statusCode: code, + } } -/* ListOAuth2ClientsInternalServerError describes a response with status code 500, with default header values. +/*ListOAuth2ClientsDefault handles this case with default header values. jsonError */ -type ListOAuth2ClientsInternalServerError struct { +type ListOAuth2ClientsDefault struct { + _statusCode int + Payload *models.JSONError } -func (o *ListOAuth2ClientsInternalServerError) Error() string { - return fmt.Sprintf("[GET /clients][%d] listOAuth2ClientsInternalServerError %+v", 500, o.Payload) +// Code gets the status code for the list o auth2 clients default response +func (o *ListOAuth2ClientsDefault) Code() int { + return o._statusCode +} + +func (o *ListOAuth2ClientsDefault) Error() string { + return fmt.Sprintf("[GET /clients][%d] listOAuth2Clients default %+v", o._statusCode, o.Payload) } -func (o *ListOAuth2ClientsInternalServerError) GetPayload() *models.JSONError { + +func (o *ListOAuth2ClientsDefault) GetPayload() *models.JSONError { return o.Payload } -func (o *ListOAuth2ClientsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ListOAuth2ClientsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.JSONError) diff --git a/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go b/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go index 6788e8f5dab..bca88f73d5f 100644 --- a/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go +++ b/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListSubjectConsentSessionsParams creates a new ListSubjectConsentSessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewListSubjectConsentSessionsParams creates a new ListSubjectConsentSessionsParams object +// with the default values initialized. func NewListSubjectConsentSessionsParams() *ListSubjectConsentSessionsParams { + var () return &ListSubjectConsentSessionsParams{ + timeout: cr.DefaultTimeout, } } // NewListSubjectConsentSessionsParamsWithTimeout creates a new ListSubjectConsentSessionsParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewListSubjectConsentSessionsParamsWithTimeout(timeout time.Duration) *ListSubjectConsentSessionsParams { + var () return &ListSubjectConsentSessionsParams{ + timeout: timeout, } } // NewListSubjectConsentSessionsParamsWithContext creates a new ListSubjectConsentSessionsParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewListSubjectConsentSessionsParamsWithContext(ctx context.Context) *ListSubjectConsentSessionsParams { + var () return &ListSubjectConsentSessionsParams{ + Context: ctx, } } // NewListSubjectConsentSessionsParamsWithHTTPClient creates a new ListSubjectConsentSessionsParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewListSubjectConsentSessionsParamsWithHTTPClient(client *http.Client) *ListSubjectConsentSessionsParams { + var () return &ListSubjectConsentSessionsParams{ HTTPClient: client, } } -/* ListSubjectConsentSessionsParams contains all the parameters to send to the API endpoint - for the list subject consent sessions operation. - - Typically these are written to a http.Request. +/*ListSubjectConsentSessionsParams contains all the parameters to send to the API endpoint +for the list subject consent sessions operation typically these are written to a http.Request */ type ListSubjectConsentSessionsParams struct { - // Subject. + /*Subject*/ Subject string timeout time.Duration @@ -67,21 +68,6 @@ type ListSubjectConsentSessionsParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the list subject consent sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSubjectConsentSessionsParams) WithDefaults() *ListSubjectConsentSessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list subject consent sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSubjectConsentSessionsParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the list subject consent sessions params func (o *ListSubjectConsentSessionsParams) WithTimeout(timeout time.Duration) *ListSubjectConsentSessionsParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *ListSubjectConsentSessionsParams) WriteToRequest(r runtime.ClientReques qrSubject := o.Subject qSubject := qrSubject if qSubject != "" { - if err := r.SetQueryParam("subject", qSubject); err != nil { return err } diff --git a/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go b/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go index 4fc96215fce..009ebef70a9 100644 --- a/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go +++ b/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go @@ -41,8 +41,9 @@ func (o *ListSubjectConsentSessionsReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewListSubjectConsentSessionsOK() *ListSubjectConsentSessionsOK { return &ListSubjectConsentSessionsOK{} } -/* ListSubjectConsentSessionsOK describes a response with status code 200, with default header values. +/*ListSubjectConsentSessionsOK handles this case with default header values. A list of used consent requests. */ @@ -62,6 +63,7 @@ type ListSubjectConsentSessionsOK struct { func (o *ListSubjectConsentSessionsOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/sessions/consent][%d] listSubjectConsentSessionsOK %+v", 200, o.Payload) } + func (o *ListSubjectConsentSessionsOK) GetPayload() []*models.PreviousConsentSession { return o.Payload } @@ -81,7 +83,7 @@ func NewListSubjectConsentSessionsBadRequest() *ListSubjectConsentSessionsBadReq return &ListSubjectConsentSessionsBadRequest{} } -/* ListSubjectConsentSessionsBadRequest describes a response with status code 400, with default header values. +/*ListSubjectConsentSessionsBadRequest handles this case with default header values. jsonError */ @@ -92,6 +94,7 @@ type ListSubjectConsentSessionsBadRequest struct { func (o *ListSubjectConsentSessionsBadRequest) Error() string { return fmt.Sprintf("[GET /oauth2/auth/sessions/consent][%d] listSubjectConsentSessionsBadRequest %+v", 400, o.Payload) } + func (o *ListSubjectConsentSessionsBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -113,7 +116,7 @@ func NewListSubjectConsentSessionsInternalServerError() *ListSubjectConsentSessi return &ListSubjectConsentSessionsInternalServerError{} } -/* ListSubjectConsentSessionsInternalServerError describes a response with status code 500, with default header values. +/*ListSubjectConsentSessionsInternalServerError handles this case with default header values. jsonError */ @@ -124,6 +127,7 @@ type ListSubjectConsentSessionsInternalServerError struct { func (o *ListSubjectConsentSessionsInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/sessions/consent][%d] listSubjectConsentSessionsInternalServerError %+v", 500, o.Payload) } + func (o *ListSubjectConsentSessionsInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go b/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go index bb40dbefc65..1e35ba6e391 100644 --- a/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewPatchOAuth2ClientParams creates a new PatchOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewPatchOAuth2ClientParams creates a new PatchOAuth2ClientParams object +// with the default values initialized. func NewPatchOAuth2ClientParams() *PatchOAuth2ClientParams { + var () return &PatchOAuth2ClientParams{ + timeout: cr.DefaultTimeout, } } // NewPatchOAuth2ClientParamsWithTimeout creates a new PatchOAuth2ClientParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewPatchOAuth2ClientParamsWithTimeout(timeout time.Duration) *PatchOAuth2ClientParams { + var () return &PatchOAuth2ClientParams{ + timeout: timeout, } } // NewPatchOAuth2ClientParamsWithContext creates a new PatchOAuth2ClientParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewPatchOAuth2ClientParamsWithContext(ctx context.Context) *PatchOAuth2ClientParams { + var () return &PatchOAuth2ClientParams{ + Context: ctx, } } // NewPatchOAuth2ClientParamsWithHTTPClient creates a new PatchOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewPatchOAuth2ClientParamsWithHTTPClient(client *http.Client) *PatchOAuth2ClientParams { + var () return &PatchOAuth2ClientParams{ HTTPClient: client, } } -/* PatchOAuth2ClientParams contains all the parameters to send to the API endpoint - for the patch o auth2 client operation. - - Typically these are written to a http.Request. +/*PatchOAuth2ClientParams contains all the parameters to send to the API endpoint +for the patch o auth2 client operation typically these are written to a http.Request */ type PatchOAuth2ClientParams struct { - // Body. + /*Body*/ Body models.PatchRequest - - // ID. + /*ID*/ ID string timeout time.Duration @@ -72,21 +72,6 @@ type PatchOAuth2ClientParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the patch o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchOAuth2ClientParams) WithDefaults() *PatchOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the patch o auth2 client params func (o *PatchOAuth2ClientParams) WithTimeout(timeout time.Duration) *PatchOAuth2ClientParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *PatchOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg st return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/patch_o_auth2_client_responses.go b/internal/httpclient/client/admin/patch_o_auth2_client_responses.go index 9415c04a86c..3b29b2e4da9 100644 --- a/internal/httpclient/client/admin/patch_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/patch_o_auth2_client_responses.go @@ -29,14 +29,15 @@ func (o *PatchOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return result, nil - case 500: - result := NewPatchOAuth2ClientInternalServerError() + default: + result := NewPatchOAuth2ClientDefault(response.Code()) if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } + if response.Code()/100 == 2 { + return result, nil + } return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewPatchOAuth2ClientOK() *PatchOAuth2ClientOK { return &PatchOAuth2ClientOK{} } -/* PatchOAuth2ClientOK describes a response with status code 200, with default header values. +/*PatchOAuth2ClientOK handles this case with default header values. oAuth2Client */ @@ -56,6 +57,7 @@ type PatchOAuth2ClientOK struct { func (o *PatchOAuth2ClientOK) Error() string { return fmt.Sprintf("[PATCH /clients/{id}][%d] patchOAuth2ClientOK %+v", 200, o.Payload) } + func (o *PatchOAuth2ClientOK) GetPayload() *models.OAuth2Client { return o.Payload } @@ -72,27 +74,37 @@ func (o *PatchOAuth2ClientOK) readResponse(response runtime.ClientResponse, cons return nil } -// NewPatchOAuth2ClientInternalServerError creates a PatchOAuth2ClientInternalServerError with default headers values -func NewPatchOAuth2ClientInternalServerError() *PatchOAuth2ClientInternalServerError { - return &PatchOAuth2ClientInternalServerError{} +// NewPatchOAuth2ClientDefault creates a PatchOAuth2ClientDefault with default headers values +func NewPatchOAuth2ClientDefault(code int) *PatchOAuth2ClientDefault { + return &PatchOAuth2ClientDefault{ + _statusCode: code, + } } -/* PatchOAuth2ClientInternalServerError describes a response with status code 500, with default header values. +/*PatchOAuth2ClientDefault handles this case with default header values. jsonError */ -type PatchOAuth2ClientInternalServerError struct { +type PatchOAuth2ClientDefault struct { + _statusCode int + Payload *models.JSONError } -func (o *PatchOAuth2ClientInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /clients/{id}][%d] patchOAuth2ClientInternalServerError %+v", 500, o.Payload) +// Code gets the status code for the patch o auth2 client default response +func (o *PatchOAuth2ClientDefault) Code() int { + return o._statusCode +} + +func (o *PatchOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[PATCH /clients/{id}][%d] patchOAuth2Client default %+v", o._statusCode, o.Payload) } -func (o *PatchOAuth2ClientInternalServerError) GetPayload() *models.JSONError { + +func (o *PatchOAuth2ClientDefault) GetPayload() *models.JSONError { return o.Payload } -func (o *PatchOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *PatchOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.JSONError) diff --git a/internal/httpclient/client/admin/reject_consent_request_parameters.go b/internal/httpclient/client/admin/reject_consent_request_parameters.go index a71725bd0ed..eba20d4bd3e 100644 --- a/internal/httpclient/client/admin/reject_consent_request_parameters.go +++ b/internal/httpclient/client/admin/reject_consent_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewRejectConsentRequestParams creates a new RejectConsentRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRejectConsentRequestParams creates a new RejectConsentRequestParams object +// with the default values initialized. func NewRejectConsentRequestParams() *RejectConsentRequestParams { + var () return &RejectConsentRequestParams{ + timeout: cr.DefaultTimeout, } } // NewRejectConsentRequestParamsWithTimeout creates a new RejectConsentRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRejectConsentRequestParamsWithTimeout(timeout time.Duration) *RejectConsentRequestParams { + var () return &RejectConsentRequestParams{ + timeout: timeout, } } // NewRejectConsentRequestParamsWithContext creates a new RejectConsentRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRejectConsentRequestParamsWithContext(ctx context.Context) *RejectConsentRequestParams { + var () return &RejectConsentRequestParams{ + Context: ctx, } } // NewRejectConsentRequestParamsWithHTTPClient creates a new RejectConsentRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRejectConsentRequestParamsWithHTTPClient(client *http.Client) *RejectConsentRequestParams { + var () return &RejectConsentRequestParams{ HTTPClient: client, } } -/* RejectConsentRequestParams contains all the parameters to send to the API endpoint - for the reject consent request operation. - - Typically these are written to a http.Request. +/*RejectConsentRequestParams contains all the parameters to send to the API endpoint +for the reject consent request operation typically these are written to a http.Request */ type RejectConsentRequestParams struct { - // Body. + /*Body*/ Body *models.RejectRequest - - // ConsentChallenge. + /*ConsentChallenge*/ ConsentChallenge string timeout time.Duration @@ -72,21 +72,6 @@ type RejectConsentRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the reject consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectConsentRequestParams) WithDefaults() *RejectConsentRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the reject consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectConsentRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the reject consent request params func (o *RejectConsentRequestParams) WithTimeout(timeout time.Duration) *RejectConsentRequestParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *RejectConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -159,7 +145,6 @@ func (o *RejectConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrConsentChallenge := o.ConsentChallenge qConsentChallenge := qrConsentChallenge if qConsentChallenge != "" { - if err := r.SetQueryParam("consent_challenge", qConsentChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/reject_consent_request_responses.go b/internal/httpclient/client/admin/reject_consent_request_responses.go index 16e00fe420c..9f300b01793 100644 --- a/internal/httpclient/client/admin/reject_consent_request_responses.go +++ b/internal/httpclient/client/admin/reject_consent_request_responses.go @@ -41,8 +41,9 @@ func (o *RejectConsentRequestReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewRejectConsentRequestOK() *RejectConsentRequestOK { return &RejectConsentRequestOK{} } -/* RejectConsentRequestOK describes a response with status code 200, with default header values. +/*RejectConsentRequestOK handles this case with default header values. completedRequest */ @@ -62,6 +63,7 @@ type RejectConsentRequestOK struct { func (o *RejectConsentRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/reject][%d] rejectConsentRequestOK %+v", 200, o.Payload) } + func (o *RejectConsentRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -83,7 +85,7 @@ func NewRejectConsentRequestNotFound() *RejectConsentRequestNotFound { return &RejectConsentRequestNotFound{} } -/* RejectConsentRequestNotFound describes a response with status code 404, with default header values. +/*RejectConsentRequestNotFound handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type RejectConsentRequestNotFound struct { func (o *RejectConsentRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/reject][%d] rejectConsentRequestNotFound %+v", 404, o.Payload) } + func (o *RejectConsentRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewRejectConsentRequestInternalServerError() *RejectConsentRequestInternalS return &RejectConsentRequestInternalServerError{} } -/* RejectConsentRequestInternalServerError describes a response with status code 500, with default header values. +/*RejectConsentRequestInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type RejectConsentRequestInternalServerError struct { func (o *RejectConsentRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/reject][%d] rejectConsentRequestInternalServerError %+v", 500, o.Payload) } + func (o *RejectConsentRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/reject_login_request_parameters.go b/internal/httpclient/client/admin/reject_login_request_parameters.go index 300a4e9b1c3..03556b805fc 100644 --- a/internal/httpclient/client/admin/reject_login_request_parameters.go +++ b/internal/httpclient/client/admin/reject_login_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewRejectLoginRequestParams creates a new RejectLoginRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRejectLoginRequestParams creates a new RejectLoginRequestParams object +// with the default values initialized. func NewRejectLoginRequestParams() *RejectLoginRequestParams { + var () return &RejectLoginRequestParams{ + timeout: cr.DefaultTimeout, } } // NewRejectLoginRequestParamsWithTimeout creates a new RejectLoginRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRejectLoginRequestParamsWithTimeout(timeout time.Duration) *RejectLoginRequestParams { + var () return &RejectLoginRequestParams{ + timeout: timeout, } } // NewRejectLoginRequestParamsWithContext creates a new RejectLoginRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRejectLoginRequestParamsWithContext(ctx context.Context) *RejectLoginRequestParams { + var () return &RejectLoginRequestParams{ + Context: ctx, } } // NewRejectLoginRequestParamsWithHTTPClient creates a new RejectLoginRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRejectLoginRequestParamsWithHTTPClient(client *http.Client) *RejectLoginRequestParams { + var () return &RejectLoginRequestParams{ HTTPClient: client, } } -/* RejectLoginRequestParams contains all the parameters to send to the API endpoint - for the reject login request operation. - - Typically these are written to a http.Request. +/*RejectLoginRequestParams contains all the parameters to send to the API endpoint +for the reject login request operation typically these are written to a http.Request */ type RejectLoginRequestParams struct { - // Body. + /*Body*/ Body *models.RejectRequest - - // LoginChallenge. + /*LoginChallenge*/ LoginChallenge string timeout time.Duration @@ -72,21 +72,6 @@ type RejectLoginRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the reject login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectLoginRequestParams) WithDefaults() *RejectLoginRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the reject login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectLoginRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the reject login request params func (o *RejectLoginRequestParams) WithTimeout(timeout time.Duration) *RejectLoginRequestParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *RejectLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -159,7 +145,6 @@ func (o *RejectLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s qrLoginChallenge := o.LoginChallenge qLoginChallenge := qrLoginChallenge if qLoginChallenge != "" { - if err := r.SetQueryParam("login_challenge", qLoginChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/reject_login_request_responses.go b/internal/httpclient/client/admin/reject_login_request_responses.go index aa45932f0c7..edc2b3e66ad 100644 --- a/internal/httpclient/client/admin/reject_login_request_responses.go +++ b/internal/httpclient/client/admin/reject_login_request_responses.go @@ -53,8 +53,9 @@ func (o *RejectLoginRequestReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -63,7 +64,7 @@ func NewRejectLoginRequestOK() *RejectLoginRequestOK { return &RejectLoginRequestOK{} } -/* RejectLoginRequestOK describes a response with status code 200, with default header values. +/*RejectLoginRequestOK handles this case with default header values. completedRequest */ @@ -74,6 +75,7 @@ type RejectLoginRequestOK struct { func (o *RejectLoginRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestOK %+v", 200, o.Payload) } + func (o *RejectLoginRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -95,7 +97,7 @@ func NewRejectLoginRequestBadRequest() *RejectLoginRequestBadRequest { return &RejectLoginRequestBadRequest{} } -/* RejectLoginRequestBadRequest describes a response with status code 400, with default header values. +/*RejectLoginRequestBadRequest handles this case with default header values. jsonError */ @@ -106,6 +108,7 @@ type RejectLoginRequestBadRequest struct { func (o *RejectLoginRequestBadRequest) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestBadRequest %+v", 400, o.Payload) } + func (o *RejectLoginRequestBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -127,7 +130,7 @@ func NewRejectLoginRequestUnauthorized() *RejectLoginRequestUnauthorized { return &RejectLoginRequestUnauthorized{} } -/* RejectLoginRequestUnauthorized describes a response with status code 401, with default header values. +/*RejectLoginRequestUnauthorized handles this case with default header values. jsonError */ @@ -138,6 +141,7 @@ type RejectLoginRequestUnauthorized struct { func (o *RejectLoginRequestUnauthorized) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestUnauthorized %+v", 401, o.Payload) } + func (o *RejectLoginRequestUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -159,7 +163,7 @@ func NewRejectLoginRequestNotFound() *RejectLoginRequestNotFound { return &RejectLoginRequestNotFound{} } -/* RejectLoginRequestNotFound describes a response with status code 404, with default header values. +/*RejectLoginRequestNotFound handles this case with default header values. jsonError */ @@ -170,6 +174,7 @@ type RejectLoginRequestNotFound struct { func (o *RejectLoginRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestNotFound %+v", 404, o.Payload) } + func (o *RejectLoginRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -191,7 +196,7 @@ func NewRejectLoginRequestInternalServerError() *RejectLoginRequestInternalServe return &RejectLoginRequestInternalServerError{} } -/* RejectLoginRequestInternalServerError describes a response with status code 500, with default header values. +/*RejectLoginRequestInternalServerError handles this case with default header values. jsonError */ @@ -202,6 +207,7 @@ type RejectLoginRequestInternalServerError struct { func (o *RejectLoginRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestInternalServerError %+v", 500, o.Payload) } + func (o *RejectLoginRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/reject_logout_request_parameters.go b/internal/httpclient/client/admin/reject_logout_request_parameters.go index f39e96898b2..be87d346429 100644 --- a/internal/httpclient/client/admin/reject_logout_request_parameters.go +++ b/internal/httpclient/client/admin/reject_logout_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewRejectLogoutRequestParams creates a new RejectLogoutRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRejectLogoutRequestParams creates a new RejectLogoutRequestParams object +// with the default values initialized. func NewRejectLogoutRequestParams() *RejectLogoutRequestParams { + var () return &RejectLogoutRequestParams{ + timeout: cr.DefaultTimeout, } } // NewRejectLogoutRequestParamsWithTimeout creates a new RejectLogoutRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRejectLogoutRequestParamsWithTimeout(timeout time.Duration) *RejectLogoutRequestParams { + var () return &RejectLogoutRequestParams{ + timeout: timeout, } } // NewRejectLogoutRequestParamsWithContext creates a new RejectLogoutRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRejectLogoutRequestParamsWithContext(ctx context.Context) *RejectLogoutRequestParams { + var () return &RejectLogoutRequestParams{ + Context: ctx, } } // NewRejectLogoutRequestParamsWithHTTPClient creates a new RejectLogoutRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRejectLogoutRequestParamsWithHTTPClient(client *http.Client) *RejectLogoutRequestParams { + var () return &RejectLogoutRequestParams{ HTTPClient: client, } } -/* RejectLogoutRequestParams contains all the parameters to send to the API endpoint - for the reject logout request operation. - - Typically these are written to a http.Request. +/*RejectLogoutRequestParams contains all the parameters to send to the API endpoint +for the reject logout request operation typically these are written to a http.Request */ type RejectLogoutRequestParams struct { - // Body. + /*Body*/ Body *models.RejectRequest - - // LogoutChallenge. + /*LogoutChallenge*/ LogoutChallenge string timeout time.Duration @@ -72,21 +72,6 @@ type RejectLogoutRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the reject logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectLogoutRequestParams) WithDefaults() *RejectLogoutRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the reject logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectLogoutRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the reject logout request params func (o *RejectLogoutRequestParams) WithTimeout(timeout time.Duration) *RejectLogoutRequestParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *RejectLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -159,7 +145,6 @@ func (o *RejectLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrLogoutChallenge := o.LogoutChallenge qLogoutChallenge := qrLogoutChallenge if qLogoutChallenge != "" { - if err := r.SetQueryParam("logout_challenge", qLogoutChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/reject_logout_request_responses.go b/internal/httpclient/client/admin/reject_logout_request_responses.go index 0ebd365c5a6..30181ba0928 100644 --- a/internal/httpclient/client/admin/reject_logout_request_responses.go +++ b/internal/httpclient/client/admin/reject_logout_request_responses.go @@ -41,8 +41,9 @@ func (o *RejectLogoutRequestReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewRejectLogoutRequestNoContent() *RejectLogoutRequestNoContent { return &RejectLogoutRequestNoContent{} } -/* RejectLogoutRequestNoContent describes a response with status code 204, with default header values. +/*RejectLogoutRequestNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RejectLogoutRequestNoContent struct { @@ -73,7 +74,7 @@ func NewRejectLogoutRequestNotFound() *RejectLogoutRequestNotFound { return &RejectLogoutRequestNotFound{} } -/* RejectLogoutRequestNotFound describes a response with status code 404, with default header values. +/*RejectLogoutRequestNotFound handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type RejectLogoutRequestNotFound struct { func (o *RejectLogoutRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/reject][%d] rejectLogoutRequestNotFound %+v", 404, o.Payload) } + func (o *RejectLogoutRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewRejectLogoutRequestInternalServerError() *RejectLogoutRequestInternalSer return &RejectLogoutRequestInternalServerError{} } -/* RejectLogoutRequestInternalServerError describes a response with status code 500, with default header values. +/*RejectLogoutRequestInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type RejectLogoutRequestInternalServerError struct { func (o *RejectLogoutRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/reject][%d] rejectLogoutRequestInternalServerError %+v", 500, o.Payload) } + func (o *RejectLogoutRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/revoke_authentication_session_parameters.go b/internal/httpclient/client/admin/revoke_authentication_session_parameters.go index 780e8fd0266..dab7c8b54dd 100644 --- a/internal/httpclient/client/admin/revoke_authentication_session_parameters.go +++ b/internal/httpclient/client/admin/revoke_authentication_session_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRevokeAuthenticationSessionParams creates a new RevokeAuthenticationSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRevokeAuthenticationSessionParams creates a new RevokeAuthenticationSessionParams object +// with the default values initialized. func NewRevokeAuthenticationSessionParams() *RevokeAuthenticationSessionParams { + var () return &RevokeAuthenticationSessionParams{ + timeout: cr.DefaultTimeout, } } // NewRevokeAuthenticationSessionParamsWithTimeout creates a new RevokeAuthenticationSessionParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRevokeAuthenticationSessionParamsWithTimeout(timeout time.Duration) *RevokeAuthenticationSessionParams { + var () return &RevokeAuthenticationSessionParams{ + timeout: timeout, } } // NewRevokeAuthenticationSessionParamsWithContext creates a new RevokeAuthenticationSessionParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRevokeAuthenticationSessionParamsWithContext(ctx context.Context) *RevokeAuthenticationSessionParams { + var () return &RevokeAuthenticationSessionParams{ + Context: ctx, } } // NewRevokeAuthenticationSessionParamsWithHTTPClient creates a new RevokeAuthenticationSessionParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRevokeAuthenticationSessionParamsWithHTTPClient(client *http.Client) *RevokeAuthenticationSessionParams { + var () return &RevokeAuthenticationSessionParams{ HTTPClient: client, } } -/* RevokeAuthenticationSessionParams contains all the parameters to send to the API endpoint - for the revoke authentication session operation. - - Typically these are written to a http.Request. +/*RevokeAuthenticationSessionParams contains all the parameters to send to the API endpoint +for the revoke authentication session operation typically these are written to a http.Request */ type RevokeAuthenticationSessionParams struct { - // Subject. + /*Subject*/ Subject string timeout time.Duration @@ -67,21 +68,6 @@ type RevokeAuthenticationSessionParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the revoke authentication session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeAuthenticationSessionParams) WithDefaults() *RevokeAuthenticationSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the revoke authentication session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeAuthenticationSessionParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the revoke authentication session params func (o *RevokeAuthenticationSessionParams) WithTimeout(timeout time.Duration) *RevokeAuthenticationSessionParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *RevokeAuthenticationSessionParams) WriteToRequest(r runtime.ClientReque qrSubject := o.Subject qSubject := qrSubject if qSubject != "" { - if err := r.SetQueryParam("subject", qSubject); err != nil { return err } diff --git a/internal/httpclient/client/admin/revoke_authentication_session_responses.go b/internal/httpclient/client/admin/revoke_authentication_session_responses.go index ae2ae24e964..bd18b558cd4 100644 --- a/internal/httpclient/client/admin/revoke_authentication_session_responses.go +++ b/internal/httpclient/client/admin/revoke_authentication_session_responses.go @@ -41,8 +41,9 @@ func (o *RevokeAuthenticationSessionReader) ReadResponse(response runtime.Client return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewRevokeAuthenticationSessionNoContent() *RevokeAuthenticationSessionNoCon return &RevokeAuthenticationSessionNoContent{} } -/* RevokeAuthenticationSessionNoContent describes a response with status code 204, with default header values. +/*RevokeAuthenticationSessionNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RevokeAuthenticationSessionNoContent struct { @@ -73,7 +74,7 @@ func NewRevokeAuthenticationSessionBadRequest() *RevokeAuthenticationSessionBadR return &RevokeAuthenticationSessionBadRequest{} } -/* RevokeAuthenticationSessionBadRequest describes a response with status code 400, with default header values. +/*RevokeAuthenticationSessionBadRequest handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type RevokeAuthenticationSessionBadRequest struct { func (o *RevokeAuthenticationSessionBadRequest) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/login][%d] revokeAuthenticationSessionBadRequest %+v", 400, o.Payload) } + func (o *RevokeAuthenticationSessionBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewRevokeAuthenticationSessionInternalServerError() *RevokeAuthenticationSe return &RevokeAuthenticationSessionInternalServerError{} } -/* RevokeAuthenticationSessionInternalServerError describes a response with status code 500, with default header values. +/*RevokeAuthenticationSessionInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type RevokeAuthenticationSessionInternalServerError struct { func (o *RevokeAuthenticationSessionInternalServerError) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/login][%d] revokeAuthenticationSessionInternalServerError %+v", 500, o.Payload) } + func (o *RevokeAuthenticationSessionInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go b/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go index 357224b576f..6dadc668afd 100644 --- a/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go +++ b/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go @@ -17,64 +17,63 @@ import ( "github.com/go-openapi/swag" ) -// NewRevokeConsentSessionsParams creates a new RevokeConsentSessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRevokeConsentSessionsParams creates a new RevokeConsentSessionsParams object +// with the default values initialized. func NewRevokeConsentSessionsParams() *RevokeConsentSessionsParams { + var () return &RevokeConsentSessionsParams{ + timeout: cr.DefaultTimeout, } } // NewRevokeConsentSessionsParamsWithTimeout creates a new RevokeConsentSessionsParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRevokeConsentSessionsParamsWithTimeout(timeout time.Duration) *RevokeConsentSessionsParams { + var () return &RevokeConsentSessionsParams{ + timeout: timeout, } } // NewRevokeConsentSessionsParamsWithContext creates a new RevokeConsentSessionsParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRevokeConsentSessionsParamsWithContext(ctx context.Context) *RevokeConsentSessionsParams { + var () return &RevokeConsentSessionsParams{ + Context: ctx, } } // NewRevokeConsentSessionsParamsWithHTTPClient creates a new RevokeConsentSessionsParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRevokeConsentSessionsParamsWithHTTPClient(client *http.Client) *RevokeConsentSessionsParams { + var () return &RevokeConsentSessionsParams{ HTTPClient: client, } } -/* RevokeConsentSessionsParams contains all the parameters to send to the API endpoint - for the revoke consent sessions operation. - - Typically these are written to a http.Request. +/*RevokeConsentSessionsParams contains all the parameters to send to the API endpoint +for the revoke consent sessions operation typically these are written to a http.Request */ type RevokeConsentSessionsParams struct { - /* All. + /*All + If set to `?all=true`, deletes all consent sessions by the Subject that have been granted. - If set to `?all=true`, deletes all consent sessions by the Subject that have been granted. */ All *bool + /*Client + If set, deletes only those consent sessions by the Subject that have been granted to the specified OAuth 2.0 Client ID - /* Client. - - If set, deletes only those consent sessions by the Subject that have been granted to the specified OAuth 2.0 Client ID */ Client *string + /*Subject + The subject (Subject) who's consent sessions should be deleted. - /* Subject. - - The subject (Subject) who's consent sessions should be deleted. */ Subject string @@ -83,21 +82,6 @@ type RevokeConsentSessionsParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the revoke consent sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeConsentSessionsParams) WithDefaults() *RevokeConsentSessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the revoke consent sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeConsentSessionsParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the revoke consent sessions params func (o *RevokeConsentSessionsParams) WithTimeout(timeout time.Duration) *RevokeConsentSessionsParams { o.SetTimeout(timeout) @@ -176,41 +160,38 @@ func (o *RevokeConsentSessionsParams) WriteToRequest(r runtime.ClientRequest, re // query param all var qrAll bool - if o.All != nil { qrAll = *o.All } qAll := swag.FormatBool(qrAll) if qAll != "" { - if err := r.SetQueryParam("all", qAll); err != nil { return err } } + } if o.Client != nil { // query param client var qrClient string - if o.Client != nil { qrClient = *o.Client } qClient := qrClient if qClient != "" { - if err := r.SetQueryParam("client", qClient); err != nil { return err } } + } // query param subject qrSubject := o.Subject qSubject := qrSubject if qSubject != "" { - if err := r.SetQueryParam("subject", qSubject); err != nil { return err } diff --git a/internal/httpclient/client/admin/revoke_consent_sessions_responses.go b/internal/httpclient/client/admin/revoke_consent_sessions_responses.go index 168fe30d353..fdff5894287 100644 --- a/internal/httpclient/client/admin/revoke_consent_sessions_responses.go +++ b/internal/httpclient/client/admin/revoke_consent_sessions_responses.go @@ -41,8 +41,9 @@ func (o *RevokeConsentSessionsReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewRevokeConsentSessionsNoContent() *RevokeConsentSessionsNoContent { return &RevokeConsentSessionsNoContent{} } -/* RevokeConsentSessionsNoContent describes a response with status code 204, with default header values. +/*RevokeConsentSessionsNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RevokeConsentSessionsNoContent struct { @@ -73,7 +74,7 @@ func NewRevokeConsentSessionsBadRequest() *RevokeConsentSessionsBadRequest { return &RevokeConsentSessionsBadRequest{} } -/* RevokeConsentSessionsBadRequest describes a response with status code 400, with default header values. +/*RevokeConsentSessionsBadRequest handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type RevokeConsentSessionsBadRequest struct { func (o *RevokeConsentSessionsBadRequest) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/consent][%d] revokeConsentSessionsBadRequest %+v", 400, o.Payload) } + func (o *RevokeConsentSessionsBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewRevokeConsentSessionsInternalServerError() *RevokeConsentSessionsInterna return &RevokeConsentSessionsInternalServerError{} } -/* RevokeConsentSessionsInternalServerError describes a response with status code 500, with default header values. +/*RevokeConsentSessionsInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type RevokeConsentSessionsInternalServerError struct { func (o *RevokeConsentSessionsInternalServerError) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/consent][%d] revokeConsentSessionsInternalServerError %+v", 500, o.Payload) } + func (o *RevokeConsentSessionsInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/update_json_web_key_parameters.go b/internal/httpclient/client/admin/update_json_web_key_parameters.go index 1d58a24513f..23d00be45c1 100644 --- a/internal/httpclient/client/admin/update_json_web_key_parameters.go +++ b/internal/httpclient/client/admin/update_json_web_key_parameters.go @@ -18,61 +18,60 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewUpdateJSONWebKeyParams creates a new UpdateJSONWebKeyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewUpdateJSONWebKeyParams creates a new UpdateJSONWebKeyParams object +// with the default values initialized. func NewUpdateJSONWebKeyParams() *UpdateJSONWebKeyParams { + var () return &UpdateJSONWebKeyParams{ + timeout: cr.DefaultTimeout, } } // NewUpdateJSONWebKeyParamsWithTimeout creates a new UpdateJSONWebKeyParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewUpdateJSONWebKeyParamsWithTimeout(timeout time.Duration) *UpdateJSONWebKeyParams { + var () return &UpdateJSONWebKeyParams{ + timeout: timeout, } } // NewUpdateJSONWebKeyParamsWithContext creates a new UpdateJSONWebKeyParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewUpdateJSONWebKeyParamsWithContext(ctx context.Context) *UpdateJSONWebKeyParams { + var () return &UpdateJSONWebKeyParams{ + Context: ctx, } } // NewUpdateJSONWebKeyParamsWithHTTPClient creates a new UpdateJSONWebKeyParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewUpdateJSONWebKeyParamsWithHTTPClient(client *http.Client) *UpdateJSONWebKeyParams { + var () return &UpdateJSONWebKeyParams{ HTTPClient: client, } } -/* UpdateJSONWebKeyParams contains all the parameters to send to the API endpoint - for the update Json web key operation. - - Typically these are written to a http.Request. +/*UpdateJSONWebKeyParams contains all the parameters to send to the API endpoint +for the update Json web key operation typically these are written to a http.Request */ type UpdateJSONWebKeyParams struct { - // Body. + /*Body*/ Body *models.JSONWebKey + /*Kid + The kid of the desired key - /* Kid. - - The kid of the desired key */ Kid string + /*Set + The set - /* Set. - - The set */ Set string @@ -81,21 +80,6 @@ type UpdateJSONWebKeyParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the update Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateJSONWebKeyParams) WithDefaults() *UpdateJSONWebKeyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateJSONWebKeyParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the update Json web key params func (o *UpdateJSONWebKeyParams) WithTimeout(timeout time.Duration) *UpdateJSONWebKeyParams { o.SetTimeout(timeout) @@ -169,6 +153,7 @@ func (o *UpdateJSONWebKeyParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/update_json_web_key_responses.go b/internal/httpclient/client/admin/update_json_web_key_responses.go index 59ef84d5d52..fe134e053e6 100644 --- a/internal/httpclient/client/admin/update_json_web_key_responses.go +++ b/internal/httpclient/client/admin/update_json_web_key_responses.go @@ -47,8 +47,9 @@ func (o *UpdateJSONWebKeyReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewUpdateJSONWebKeyOK() *UpdateJSONWebKeyOK { return &UpdateJSONWebKeyOK{} } -/* UpdateJSONWebKeyOK describes a response with status code 200, with default header values. +/*UpdateJSONWebKeyOK handles this case with default header values. JSONWebKey */ @@ -68,6 +69,7 @@ type UpdateJSONWebKeyOK struct { func (o *UpdateJSONWebKeyOK) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyOK %+v", 200, o.Payload) } + func (o *UpdateJSONWebKeyOK) GetPayload() *models.JSONWebKey { return o.Payload } @@ -89,7 +91,7 @@ func NewUpdateJSONWebKeyUnauthorized() *UpdateJSONWebKeyUnauthorized { return &UpdateJSONWebKeyUnauthorized{} } -/* UpdateJSONWebKeyUnauthorized describes a response with status code 401, with default header values. +/*UpdateJSONWebKeyUnauthorized handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type UpdateJSONWebKeyUnauthorized struct { func (o *UpdateJSONWebKeyUnauthorized) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyUnauthorized %+v", 401, o.Payload) } + func (o *UpdateJSONWebKeyUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewUpdateJSONWebKeyForbidden() *UpdateJSONWebKeyForbidden { return &UpdateJSONWebKeyForbidden{} } -/* UpdateJSONWebKeyForbidden describes a response with status code 403, with default header values. +/*UpdateJSONWebKeyForbidden handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type UpdateJSONWebKeyForbidden struct { func (o *UpdateJSONWebKeyForbidden) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyForbidden %+v", 403, o.Payload) } + func (o *UpdateJSONWebKeyForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewUpdateJSONWebKeyInternalServerError() *UpdateJSONWebKeyInternalServerErr return &UpdateJSONWebKeyInternalServerError{} } -/* UpdateJSONWebKeyInternalServerError describes a response with status code 500, with default header values. +/*UpdateJSONWebKeyInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type UpdateJSONWebKeyInternalServerError struct { func (o *UpdateJSONWebKeyInternalServerError) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyInternalServerError %+v", 500, o.Payload) } + func (o *UpdateJSONWebKeyInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/update_json_web_key_set_parameters.go b/internal/httpclient/client/admin/update_json_web_key_set_parameters.go index 20cc85a3770..5d5de04e2f1 100644 --- a/internal/httpclient/client/admin/update_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/update_json_web_key_set_parameters.go @@ -18,55 +18,55 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewUpdateJSONWebKeySetParams creates a new UpdateJSONWebKeySetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewUpdateJSONWebKeySetParams creates a new UpdateJSONWebKeySetParams object +// with the default values initialized. func NewUpdateJSONWebKeySetParams() *UpdateJSONWebKeySetParams { + var () return &UpdateJSONWebKeySetParams{ + timeout: cr.DefaultTimeout, } } // NewUpdateJSONWebKeySetParamsWithTimeout creates a new UpdateJSONWebKeySetParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewUpdateJSONWebKeySetParamsWithTimeout(timeout time.Duration) *UpdateJSONWebKeySetParams { + var () return &UpdateJSONWebKeySetParams{ + timeout: timeout, } } // NewUpdateJSONWebKeySetParamsWithContext creates a new UpdateJSONWebKeySetParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewUpdateJSONWebKeySetParamsWithContext(ctx context.Context) *UpdateJSONWebKeySetParams { + var () return &UpdateJSONWebKeySetParams{ + Context: ctx, } } // NewUpdateJSONWebKeySetParamsWithHTTPClient creates a new UpdateJSONWebKeySetParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewUpdateJSONWebKeySetParamsWithHTTPClient(client *http.Client) *UpdateJSONWebKeySetParams { + var () return &UpdateJSONWebKeySetParams{ HTTPClient: client, } } -/* UpdateJSONWebKeySetParams contains all the parameters to send to the API endpoint - for the update Json web key set operation. - - Typically these are written to a http.Request. +/*UpdateJSONWebKeySetParams contains all the parameters to send to the API endpoint +for the update Json web key set operation typically these are written to a http.Request */ type UpdateJSONWebKeySetParams struct { - // Body. + /*Body*/ Body *models.JSONWebKeySet + /*Set + The set - /* Set. - - The set */ Set string @@ -75,21 +75,6 @@ type UpdateJSONWebKeySetParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the update Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateJSONWebKeySetParams) WithDefaults() *UpdateJSONWebKeySetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateJSONWebKeySetParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the update Json web key set params func (o *UpdateJSONWebKeySetParams) WithTimeout(timeout time.Duration) *UpdateJSONWebKeySetParams { o.SetTimeout(timeout) @@ -152,6 +137,7 @@ func (o *UpdateJSONWebKeySetParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/update_json_web_key_set_responses.go b/internal/httpclient/client/admin/update_json_web_key_set_responses.go index fbc2a60031e..b48ffb1fc13 100644 --- a/internal/httpclient/client/admin/update_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/update_json_web_key_set_responses.go @@ -47,8 +47,9 @@ func (o *UpdateJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewUpdateJSONWebKeySetOK() *UpdateJSONWebKeySetOK { return &UpdateJSONWebKeySetOK{} } -/* UpdateJSONWebKeySetOK describes a response with status code 200, with default header values. +/*UpdateJSONWebKeySetOK handles this case with default header values. JSONWebKeySet */ @@ -68,6 +69,7 @@ type UpdateJSONWebKeySetOK struct { func (o *UpdateJSONWebKeySetOK) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetOK %+v", 200, o.Payload) } + func (o *UpdateJSONWebKeySetOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -89,7 +91,7 @@ func NewUpdateJSONWebKeySetUnauthorized() *UpdateJSONWebKeySetUnauthorized { return &UpdateJSONWebKeySetUnauthorized{} } -/* UpdateJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. +/*UpdateJSONWebKeySetUnauthorized handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type UpdateJSONWebKeySetUnauthorized struct { func (o *UpdateJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetUnauthorized %+v", 401, o.Payload) } + func (o *UpdateJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewUpdateJSONWebKeySetForbidden() *UpdateJSONWebKeySetForbidden { return &UpdateJSONWebKeySetForbidden{} } -/* UpdateJSONWebKeySetForbidden describes a response with status code 403, with default header values. +/*UpdateJSONWebKeySetForbidden handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type UpdateJSONWebKeySetForbidden struct { func (o *UpdateJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetForbidden %+v", 403, o.Payload) } + func (o *UpdateJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewUpdateJSONWebKeySetInternalServerError() *UpdateJSONWebKeySetInternalSer return &UpdateJSONWebKeySetInternalServerError{} } -/* UpdateJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. +/*UpdateJSONWebKeySetInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type UpdateJSONWebKeySetInternalServerError struct { func (o *UpdateJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetInternalServerError %+v", 500, o.Payload) } + func (o *UpdateJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/update_o_auth2_client_parameters.go b/internal/httpclient/client/admin/update_o_auth2_client_parameters.go index d767532c9a0..85400c84f9f 100644 --- a/internal/httpclient/client/admin/update_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/update_o_auth2_client_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewUpdateOAuth2ClientParams creates a new UpdateOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewUpdateOAuth2ClientParams creates a new UpdateOAuth2ClientParams object +// with the default values initialized. func NewUpdateOAuth2ClientParams() *UpdateOAuth2ClientParams { + var () return &UpdateOAuth2ClientParams{ + timeout: cr.DefaultTimeout, } } // NewUpdateOAuth2ClientParamsWithTimeout creates a new UpdateOAuth2ClientParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewUpdateOAuth2ClientParamsWithTimeout(timeout time.Duration) *UpdateOAuth2ClientParams { + var () return &UpdateOAuth2ClientParams{ + timeout: timeout, } } // NewUpdateOAuth2ClientParamsWithContext creates a new UpdateOAuth2ClientParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewUpdateOAuth2ClientParamsWithContext(ctx context.Context) *UpdateOAuth2ClientParams { + var () return &UpdateOAuth2ClientParams{ + Context: ctx, } } // NewUpdateOAuth2ClientParamsWithHTTPClient creates a new UpdateOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewUpdateOAuth2ClientParamsWithHTTPClient(client *http.Client) *UpdateOAuth2ClientParams { + var () return &UpdateOAuth2ClientParams{ HTTPClient: client, } } -/* UpdateOAuth2ClientParams contains all the parameters to send to the API endpoint - for the update o auth2 client operation. - - Typically these are written to a http.Request. +/*UpdateOAuth2ClientParams contains all the parameters to send to the API endpoint +for the update o auth2 client operation typically these are written to a http.Request */ type UpdateOAuth2ClientParams struct { - // Body. + /*Body*/ Body *models.OAuth2Client - - // ID. + /*ID*/ ID string timeout time.Duration @@ -72,21 +72,6 @@ type UpdateOAuth2ClientParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the update o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateOAuth2ClientParams) WithDefaults() *UpdateOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the update o auth2 client params func (o *UpdateOAuth2ClientParams) WithTimeout(timeout time.Duration) *UpdateOAuth2ClientParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *UpdateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/update_o_auth2_client_responses.go b/internal/httpclient/client/admin/update_o_auth2_client_responses.go index ce776c59ef3..76a2975ddcd 100644 --- a/internal/httpclient/client/admin/update_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/update_o_auth2_client_responses.go @@ -29,14 +29,15 @@ func (o *UpdateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return result, nil - case 500: - result := NewUpdateOAuth2ClientInternalServerError() + default: + result := NewUpdateOAuth2ClientDefault(response.Code()) if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } + if response.Code()/100 == 2 { + return result, nil + } return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewUpdateOAuth2ClientOK() *UpdateOAuth2ClientOK { return &UpdateOAuth2ClientOK{} } -/* UpdateOAuth2ClientOK describes a response with status code 200, with default header values. +/*UpdateOAuth2ClientOK handles this case with default header values. oAuth2Client */ @@ -56,6 +57,7 @@ type UpdateOAuth2ClientOK struct { func (o *UpdateOAuth2ClientOK) Error() string { return fmt.Sprintf("[PUT /clients/{id}][%d] updateOAuth2ClientOK %+v", 200, o.Payload) } + func (o *UpdateOAuth2ClientOK) GetPayload() *models.OAuth2Client { return o.Payload } @@ -72,27 +74,37 @@ func (o *UpdateOAuth2ClientOK) readResponse(response runtime.ClientResponse, con return nil } -// NewUpdateOAuth2ClientInternalServerError creates a UpdateOAuth2ClientInternalServerError with default headers values -func NewUpdateOAuth2ClientInternalServerError() *UpdateOAuth2ClientInternalServerError { - return &UpdateOAuth2ClientInternalServerError{} +// NewUpdateOAuth2ClientDefault creates a UpdateOAuth2ClientDefault with default headers values +func NewUpdateOAuth2ClientDefault(code int) *UpdateOAuth2ClientDefault { + return &UpdateOAuth2ClientDefault{ + _statusCode: code, + } } -/* UpdateOAuth2ClientInternalServerError describes a response with status code 500, with default header values. +/*UpdateOAuth2ClientDefault handles this case with default header values. jsonError */ -type UpdateOAuth2ClientInternalServerError struct { +type UpdateOAuth2ClientDefault struct { + _statusCode int + Payload *models.JSONError } -func (o *UpdateOAuth2ClientInternalServerError) Error() string { - return fmt.Sprintf("[PUT /clients/{id}][%d] updateOAuth2ClientInternalServerError %+v", 500, o.Payload) +// Code gets the status code for the update o auth2 client default response +func (o *UpdateOAuth2ClientDefault) Code() int { + return o._statusCode +} + +func (o *UpdateOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[PUT /clients/{id}][%d] updateOAuth2Client default %+v", o._statusCode, o.Payload) } -func (o *UpdateOAuth2ClientInternalServerError) GetPayload() *models.JSONError { + +func (o *UpdateOAuth2ClientDefault) GetPayload() *models.JSONError { return o.Payload } -func (o *UpdateOAuth2ClientInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *UpdateOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.JSONError) diff --git a/internal/httpclient/client/metadata/metadata_client.go b/internal/httpclient/client/metadata/metadata_client.go index 669fe3539b1..73bf982a7e6 100644 --- a/internal/httpclient/client/metadata/metadata_client.go +++ b/internal/httpclient/client/metadata/metadata_client.go @@ -25,12 +25,9 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - // ClientService is the interface for Client methods type ClientService interface { - Prometheus(params *PrometheusParams, opts ...ClientOption) (*PrometheusOK, error) + Prometheus(params *PrometheusParams) (*PrometheusOK, error) SetTransport(transport runtime.ClientTransport) } @@ -45,12 +42,13 @@ prometheus.io/port: "4434" prometheus.io/path: "/metrics/prometheus" ``` */ -func (a *Client) Prometheus(params *PrometheusParams, opts ...ClientOption) (*PrometheusOK, error) { +func (a *Client) Prometheus(params *PrometheusParams) (*PrometheusOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPrometheusParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "prometheus", Method: "GET", PathPattern: "/metrics/prometheus", @@ -61,12 +59,7 @@ func (a *Client) Prometheus(params *PrometheusParams, opts ...ClientOption) (*Pr Reader: &PrometheusReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } diff --git a/internal/httpclient/client/metadata/prometheus_parameters.go b/internal/httpclient/client/metadata/prometheus_parameters.go index b98a921ea85..06b59ae0691 100644 --- a/internal/httpclient/client/metadata/prometheus_parameters.go +++ b/internal/httpclient/client/metadata/prometheus_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewPrometheusParams creates a new PrometheusParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewPrometheusParams creates a new PrometheusParams object +// with the default values initialized. func NewPrometheusParams() *PrometheusParams { + return &PrometheusParams{ + timeout: cr.DefaultTimeout, } } // NewPrometheusParamsWithTimeout creates a new PrometheusParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewPrometheusParamsWithTimeout(timeout time.Duration) *PrometheusParams { + return &PrometheusParams{ + timeout: timeout, } } // NewPrometheusParamsWithContext creates a new PrometheusParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewPrometheusParamsWithContext(ctx context.Context) *PrometheusParams { + return &PrometheusParams{ + Context: ctx, } } // NewPrometheusParamsWithHTTPClient creates a new PrometheusParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewPrometheusParamsWithHTTPClient(client *http.Client) *PrometheusParams { + return &PrometheusParams{ HTTPClient: client, } } -/* PrometheusParams contains all the parameters to send to the API endpoint - for the prometheus operation. - - Typically these are written to a http.Request. +/*PrometheusParams contains all the parameters to send to the API endpoint +for the prometheus operation typically these are written to a http.Request */ type PrometheusParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type PrometheusParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the prometheus params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PrometheusParams) WithDefaults() *PrometheusParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the prometheus params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PrometheusParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the prometheus params func (o *PrometheusParams) WithTimeout(timeout time.Duration) *PrometheusParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/metadata/prometheus_responses.go b/internal/httpclient/client/metadata/prometheus_responses.go index 91a18f4a176..8a4835a2d1f 100644 --- a/internal/httpclient/client/metadata/prometheus_responses.go +++ b/internal/httpclient/client/metadata/prometheus_responses.go @@ -26,8 +26,9 @@ func (o *PrometheusReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return result, nil + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -36,9 +37,9 @@ func NewPrometheusOK() *PrometheusOK { return &PrometheusOK{} } -/* PrometheusOK describes a response with status code 200, with default header values. +/*PrometheusOK handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type PrometheusOK struct { diff --git a/internal/httpclient/client/public/create_o_auth2_client_public_parameters.go b/internal/httpclient/client/public/create_o_auth2_client_public_parameters.go deleted file mode 100644 index 25f3ce99215..00000000000 --- a/internal/httpclient/client/public/create_o_auth2_client_public_parameters.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewCreateOAuth2ClientPublicParams creates a new CreateOAuth2ClientPublicParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateOAuth2ClientPublicParams() *CreateOAuth2ClientPublicParams { - return &CreateOAuth2ClientPublicParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateOAuth2ClientPublicParamsWithTimeout creates a new CreateOAuth2ClientPublicParams object -// with the ability to set a timeout on a request. -func NewCreateOAuth2ClientPublicParamsWithTimeout(timeout time.Duration) *CreateOAuth2ClientPublicParams { - return &CreateOAuth2ClientPublicParams{ - timeout: timeout, - } -} - -// NewCreateOAuth2ClientPublicParamsWithContext creates a new CreateOAuth2ClientPublicParams object -// with the ability to set a context for a request. -func NewCreateOAuth2ClientPublicParamsWithContext(ctx context.Context) *CreateOAuth2ClientPublicParams { - return &CreateOAuth2ClientPublicParams{ - Context: ctx, - } -} - -// NewCreateOAuth2ClientPublicParamsWithHTTPClient creates a new CreateOAuth2ClientPublicParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateOAuth2ClientPublicParamsWithHTTPClient(client *http.Client) *CreateOAuth2ClientPublicParams { - return &CreateOAuth2ClientPublicParams{ - HTTPClient: client, - } -} - -/* CreateOAuth2ClientPublicParams contains all the parameters to send to the API endpoint - for the create o auth2 client public operation. - - Typically these are written to a http.Request. -*/ -type CreateOAuth2ClientPublicParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create o auth2 client public params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateOAuth2ClientPublicParams) WithDefaults() *CreateOAuth2ClientPublicParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create o auth2 client public params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateOAuth2ClientPublicParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create o auth2 client public params -func (o *CreateOAuth2ClientPublicParams) WithTimeout(timeout time.Duration) *CreateOAuth2ClientPublicParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create o auth2 client public params -func (o *CreateOAuth2ClientPublicParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create o auth2 client public params -func (o *CreateOAuth2ClientPublicParams) WithContext(ctx context.Context) *CreateOAuth2ClientPublicParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create o auth2 client public params -func (o *CreateOAuth2ClientPublicParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create o auth2 client public params -func (o *CreateOAuth2ClientPublicParams) WithHTTPClient(client *http.Client) *CreateOAuth2ClientPublicParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create o auth2 client public params -func (o *CreateOAuth2ClientPublicParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateOAuth2ClientPublicParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/create_o_auth2_client_public_responses.go b/internal/httpclient/client/public/create_o_auth2_client_public_responses.go deleted file mode 100644 index 4980dbf7717..00000000000 --- a/internal/httpclient/client/public/create_o_auth2_client_public_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// CreateOAuth2ClientPublicReader is a Reader for the CreateOAuth2ClientPublic structure. -type CreateOAuth2ClientPublicReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateOAuth2ClientPublicReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateOAuth2ClientPublicCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateOAuth2ClientPublicBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreateOAuth2ClientPublicConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateOAuth2ClientPublicInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateOAuth2ClientPublicCreated creates a CreateOAuth2ClientPublicCreated with default headers values -func NewCreateOAuth2ClientPublicCreated() *CreateOAuth2ClientPublicCreated { - return &CreateOAuth2ClientPublicCreated{} -} - -/* CreateOAuth2ClientPublicCreated describes a response with status code 201, with default header values. - -oAuth2Client -*/ -type CreateOAuth2ClientPublicCreated struct { - Payload *models.OAuth2Client -} - -func (o *CreateOAuth2ClientPublicCreated) Error() string { - return fmt.Sprintf("[POST /connect/register][%d] createOAuth2ClientPublicCreated %+v", 201, o.Payload) -} -func (o *CreateOAuth2ClientPublicCreated) GetPayload() *models.OAuth2Client { - return o.Payload -} - -func (o *CreateOAuth2ClientPublicCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OAuth2Client) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateOAuth2ClientPublicBadRequest creates a CreateOAuth2ClientPublicBadRequest with default headers values -func NewCreateOAuth2ClientPublicBadRequest() *CreateOAuth2ClientPublicBadRequest { - return &CreateOAuth2ClientPublicBadRequest{} -} - -/* CreateOAuth2ClientPublicBadRequest describes a response with status code 400, with default header values. - -genericError -*/ -type CreateOAuth2ClientPublicBadRequest struct { - Payload *models.GenericError -} - -func (o *CreateOAuth2ClientPublicBadRequest) Error() string { - return fmt.Sprintf("[POST /connect/register][%d] createOAuth2ClientPublicBadRequest %+v", 400, o.Payload) -} -func (o *CreateOAuth2ClientPublicBadRequest) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *CreateOAuth2ClientPublicBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateOAuth2ClientPublicConflict creates a CreateOAuth2ClientPublicConflict with default headers values -func NewCreateOAuth2ClientPublicConflict() *CreateOAuth2ClientPublicConflict { - return &CreateOAuth2ClientPublicConflict{} -} - -/* CreateOAuth2ClientPublicConflict describes a response with status code 409, with default header values. - -genericError -*/ -type CreateOAuth2ClientPublicConflict struct { - Payload *models.GenericError -} - -func (o *CreateOAuth2ClientPublicConflict) Error() string { - return fmt.Sprintf("[POST /connect/register][%d] createOAuth2ClientPublicConflict %+v", 409, o.Payload) -} -func (o *CreateOAuth2ClientPublicConflict) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *CreateOAuth2ClientPublicConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateOAuth2ClientPublicInternalServerError creates a CreateOAuth2ClientPublicInternalServerError with default headers values -func NewCreateOAuth2ClientPublicInternalServerError() *CreateOAuth2ClientPublicInternalServerError { - return &CreateOAuth2ClientPublicInternalServerError{} -} - -/* CreateOAuth2ClientPublicInternalServerError describes a response with status code 500, with default header values. - -genericError -*/ -type CreateOAuth2ClientPublicInternalServerError struct { - Payload *models.GenericError -} - -func (o *CreateOAuth2ClientPublicInternalServerError) Error() string { - return fmt.Sprintf("[POST /connect/register][%d] createOAuth2ClientPublicInternalServerError %+v", 500, o.Payload) -} -func (o *CreateOAuth2ClientPublicInternalServerError) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *CreateOAuth2ClientPublicInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/delete_o_auth2_client_public_parameters.go b/internal/httpclient/client/public/delete_o_auth2_client_public_parameters.go deleted file mode 100644 index d478d7224d7..00000000000 --- a/internal/httpclient/client/public/delete_o_auth2_client_public_parameters.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteOAuth2ClientPublicParams creates a new DeleteOAuth2ClientPublicParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteOAuth2ClientPublicParams() *DeleteOAuth2ClientPublicParams { - return &DeleteOAuth2ClientPublicParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteOAuth2ClientPublicParamsWithTimeout creates a new DeleteOAuth2ClientPublicParams object -// with the ability to set a timeout on a request. -func NewDeleteOAuth2ClientPublicParamsWithTimeout(timeout time.Duration) *DeleteOAuth2ClientPublicParams { - return &DeleteOAuth2ClientPublicParams{ - timeout: timeout, - } -} - -// NewDeleteOAuth2ClientPublicParamsWithContext creates a new DeleteOAuth2ClientPublicParams object -// with the ability to set a context for a request. -func NewDeleteOAuth2ClientPublicParamsWithContext(ctx context.Context) *DeleteOAuth2ClientPublicParams { - return &DeleteOAuth2ClientPublicParams{ - Context: ctx, - } -} - -// NewDeleteOAuth2ClientPublicParamsWithHTTPClient creates a new DeleteOAuth2ClientPublicParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteOAuth2ClientPublicParamsWithHTTPClient(client *http.Client) *DeleteOAuth2ClientPublicParams { - return &DeleteOAuth2ClientPublicParams{ - HTTPClient: client, - } -} - -/* DeleteOAuth2ClientPublicParams contains all the parameters to send to the API endpoint - for the delete o auth2 client public operation. - - Typically these are written to a http.Request. -*/ -type DeleteOAuth2ClientPublicParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete o auth2 client public params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteOAuth2ClientPublicParams) WithDefaults() *DeleteOAuth2ClientPublicParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete o auth2 client public params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteOAuth2ClientPublicParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete o auth2 client public params -func (o *DeleteOAuth2ClientPublicParams) WithTimeout(timeout time.Duration) *DeleteOAuth2ClientPublicParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete o auth2 client public params -func (o *DeleteOAuth2ClientPublicParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete o auth2 client public params -func (o *DeleteOAuth2ClientPublicParams) WithContext(ctx context.Context) *DeleteOAuth2ClientPublicParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete o auth2 client public params -func (o *DeleteOAuth2ClientPublicParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete o auth2 client public params -func (o *DeleteOAuth2ClientPublicParams) WithHTTPClient(client *http.Client) *DeleteOAuth2ClientPublicParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete o auth2 client public params -func (o *DeleteOAuth2ClientPublicParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteOAuth2ClientPublicParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/delete_o_auth2_client_public_responses.go b/internal/httpclient/client/public/delete_o_auth2_client_public_responses.go deleted file mode 100644 index 4f14a3602fb..00000000000 --- a/internal/httpclient/client/public/delete_o_auth2_client_public_responses.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// DeleteOAuth2ClientPublicReader is a Reader for the DeleteOAuth2ClientPublic structure. -type DeleteOAuth2ClientPublicReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteOAuth2ClientPublicReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteOAuth2ClientPublicNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewDeleteOAuth2ClientPublicNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteOAuth2ClientPublicInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteOAuth2ClientPublicNoContent creates a DeleteOAuth2ClientPublicNoContent with default headers values -func NewDeleteOAuth2ClientPublicNoContent() *DeleteOAuth2ClientPublicNoContent { - return &DeleteOAuth2ClientPublicNoContent{} -} - -/* DeleteOAuth2ClientPublicNoContent describes a response with status code 204, with default header values. - - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201. -*/ -type DeleteOAuth2ClientPublicNoContent struct { -} - -func (o *DeleteOAuth2ClientPublicNoContent) Error() string { - return fmt.Sprintf("[DELETE /connect/register][%d] deleteOAuth2ClientPublicNoContent ", 204) -} - -func (o *DeleteOAuth2ClientPublicNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteOAuth2ClientPublicNotFound creates a DeleteOAuth2ClientPublicNotFound with default headers values -func NewDeleteOAuth2ClientPublicNotFound() *DeleteOAuth2ClientPublicNotFound { - return &DeleteOAuth2ClientPublicNotFound{} -} - -/* DeleteOAuth2ClientPublicNotFound describes a response with status code 404, with default header values. - -genericError -*/ -type DeleteOAuth2ClientPublicNotFound struct { - Payload *models.GenericError -} - -func (o *DeleteOAuth2ClientPublicNotFound) Error() string { - return fmt.Sprintf("[DELETE /connect/register][%d] deleteOAuth2ClientPublicNotFound %+v", 404, o.Payload) -} -func (o *DeleteOAuth2ClientPublicNotFound) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *DeleteOAuth2ClientPublicNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteOAuth2ClientPublicInternalServerError creates a DeleteOAuth2ClientPublicInternalServerError with default headers values -func NewDeleteOAuth2ClientPublicInternalServerError() *DeleteOAuth2ClientPublicInternalServerError { - return &DeleteOAuth2ClientPublicInternalServerError{} -} - -/* DeleteOAuth2ClientPublicInternalServerError describes a response with status code 500, with default header values. - -genericError -*/ -type DeleteOAuth2ClientPublicInternalServerError struct { - Payload *models.GenericError -} - -func (o *DeleteOAuth2ClientPublicInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /connect/register][%d] deleteOAuth2ClientPublicInternalServerError %+v", 500, o.Payload) -} -func (o *DeleteOAuth2ClientPublicInternalServerError) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *DeleteOAuth2ClientPublicInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/disconnect_user_parameters.go b/internal/httpclient/client/public/disconnect_user_parameters.go index e0c9b3938d5..e87c91fff85 100644 --- a/internal/httpclient/client/public/disconnect_user_parameters.go +++ b/internal/httpclient/client/public/disconnect_user_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDisconnectUserParams creates a new DisconnectUserParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDisconnectUserParams creates a new DisconnectUserParams object +// with the default values initialized. func NewDisconnectUserParams() *DisconnectUserParams { + return &DisconnectUserParams{ + timeout: cr.DefaultTimeout, } } // NewDisconnectUserParamsWithTimeout creates a new DisconnectUserParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDisconnectUserParamsWithTimeout(timeout time.Duration) *DisconnectUserParams { + return &DisconnectUserParams{ + timeout: timeout, } } // NewDisconnectUserParamsWithContext creates a new DisconnectUserParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDisconnectUserParamsWithContext(ctx context.Context) *DisconnectUserParams { + return &DisconnectUserParams{ + Context: ctx, } } // NewDisconnectUserParamsWithHTTPClient creates a new DisconnectUserParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDisconnectUserParamsWithHTTPClient(client *http.Client) *DisconnectUserParams { + return &DisconnectUserParams{ HTTPClient: client, } } -/* DisconnectUserParams contains all the parameters to send to the API endpoint - for the disconnect user operation. - - Typically these are written to a http.Request. +/*DisconnectUserParams contains all the parameters to send to the API endpoint +for the disconnect user operation typically these are written to a http.Request */ type DisconnectUserParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type DisconnectUserParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the disconnect user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisconnectUserParams) WithDefaults() *DisconnectUserParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the disconnect user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisconnectUserParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the disconnect user params func (o *DisconnectUserParams) WithTimeout(timeout time.Duration) *DisconnectUserParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/disconnect_user_responses.go b/internal/httpclient/client/public/disconnect_user_responses.go index e5a423481dd..cba4856c5ef 100644 --- a/internal/httpclient/client/public/disconnect_user_responses.go +++ b/internal/httpclient/client/public/disconnect_user_responses.go @@ -26,8 +26,9 @@ func (o *DisconnectUserReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -36,9 +37,9 @@ func NewDisconnectUserFound() *DisconnectUserFound { return &DisconnectUserFound{} } -/* DisconnectUserFound describes a response with status code 302, with default header values. +/*DisconnectUserFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DisconnectUserFound struct { diff --git a/internal/httpclient/client/public/discover_open_id_configuration_parameters.go b/internal/httpclient/client/public/discover_open_id_configuration_parameters.go index 93ff41bb9a5..db24ed1492a 100644 --- a/internal/httpclient/client/public/discover_open_id_configuration_parameters.go +++ b/internal/httpclient/client/public/discover_open_id_configuration_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDiscoverOpenIDConfigurationParams creates a new DiscoverOpenIDConfigurationParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDiscoverOpenIDConfigurationParams creates a new DiscoverOpenIDConfigurationParams object +// with the default values initialized. func NewDiscoverOpenIDConfigurationParams() *DiscoverOpenIDConfigurationParams { + return &DiscoverOpenIDConfigurationParams{ + timeout: cr.DefaultTimeout, } } // NewDiscoverOpenIDConfigurationParamsWithTimeout creates a new DiscoverOpenIDConfigurationParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDiscoverOpenIDConfigurationParamsWithTimeout(timeout time.Duration) *DiscoverOpenIDConfigurationParams { + return &DiscoverOpenIDConfigurationParams{ + timeout: timeout, } } // NewDiscoverOpenIDConfigurationParamsWithContext creates a new DiscoverOpenIDConfigurationParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDiscoverOpenIDConfigurationParamsWithContext(ctx context.Context) *DiscoverOpenIDConfigurationParams { + return &DiscoverOpenIDConfigurationParams{ + Context: ctx, } } // NewDiscoverOpenIDConfigurationParamsWithHTTPClient creates a new DiscoverOpenIDConfigurationParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDiscoverOpenIDConfigurationParamsWithHTTPClient(client *http.Client) *DiscoverOpenIDConfigurationParams { + return &DiscoverOpenIDConfigurationParams{ HTTPClient: client, } } -/* DiscoverOpenIDConfigurationParams contains all the parameters to send to the API endpoint - for the discover open ID configuration operation. - - Typically these are written to a http.Request. +/*DiscoverOpenIDConfigurationParams contains all the parameters to send to the API endpoint +for the discover open ID configuration operation typically these are written to a http.Request */ type DiscoverOpenIDConfigurationParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type DiscoverOpenIDConfigurationParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the discover open ID configuration params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DiscoverOpenIDConfigurationParams) WithDefaults() *DiscoverOpenIDConfigurationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the discover open ID configuration params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DiscoverOpenIDConfigurationParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the discover open ID configuration params func (o *DiscoverOpenIDConfigurationParams) WithTimeout(timeout time.Duration) *DiscoverOpenIDConfigurationParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/discover_open_id_configuration_responses.go b/internal/httpclient/client/public/discover_open_id_configuration_responses.go index ad0e1e75fba..a3e7a6c5b7c 100644 --- a/internal/httpclient/client/public/discover_open_id_configuration_responses.go +++ b/internal/httpclient/client/public/discover_open_id_configuration_responses.go @@ -41,8 +41,9 @@ func (o *DiscoverOpenIDConfigurationReader) ReadResponse(response runtime.Client return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewDiscoverOpenIDConfigurationOK() *DiscoverOpenIDConfigurationOK { return &DiscoverOpenIDConfigurationOK{} } -/* DiscoverOpenIDConfigurationOK describes a response with status code 200, with default header values. +/*DiscoverOpenIDConfigurationOK handles this case with default header values. wellKnown */ @@ -62,6 +63,7 @@ type DiscoverOpenIDConfigurationOK struct { func (o *DiscoverOpenIDConfigurationOK) Error() string { return fmt.Sprintf("[GET /.well-known/openid-configuration][%d] discoverOpenIdConfigurationOK %+v", 200, o.Payload) } + func (o *DiscoverOpenIDConfigurationOK) GetPayload() *models.WellKnown { return o.Payload } @@ -83,7 +85,7 @@ func NewDiscoverOpenIDConfigurationUnauthorized() *DiscoverOpenIDConfigurationUn return &DiscoverOpenIDConfigurationUnauthorized{} } -/* DiscoverOpenIDConfigurationUnauthorized describes a response with status code 401, with default header values. +/*DiscoverOpenIDConfigurationUnauthorized handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type DiscoverOpenIDConfigurationUnauthorized struct { func (o *DiscoverOpenIDConfigurationUnauthorized) Error() string { return fmt.Sprintf("[GET /.well-known/openid-configuration][%d] discoverOpenIdConfigurationUnauthorized %+v", 401, o.Payload) } + func (o *DiscoverOpenIDConfigurationUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewDiscoverOpenIDConfigurationInternalServerError() *DiscoverOpenIDConfigur return &DiscoverOpenIDConfigurationInternalServerError{} } -/* DiscoverOpenIDConfigurationInternalServerError describes a response with status code 500, with default header values. +/*DiscoverOpenIDConfigurationInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type DiscoverOpenIDConfigurationInternalServerError struct { func (o *DiscoverOpenIDConfigurationInternalServerError) Error() string { return fmt.Sprintf("[GET /.well-known/openid-configuration][%d] discoverOpenIdConfigurationInternalServerError %+v", 500, o.Payload) } + func (o *DiscoverOpenIDConfigurationInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/get_o_auth2_client_public_parameters.go b/internal/httpclient/client/public/get_o_auth2_client_public_parameters.go deleted file mode 100644 index 06a4105c46b..00000000000 --- a/internal/httpclient/client/public/get_o_auth2_client_public_parameters.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetOAuth2ClientPublicParams creates a new GetOAuth2ClientPublicParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetOAuth2ClientPublicParams() *GetOAuth2ClientPublicParams { - return &GetOAuth2ClientPublicParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetOAuth2ClientPublicParamsWithTimeout creates a new GetOAuth2ClientPublicParams object -// with the ability to set a timeout on a request. -func NewGetOAuth2ClientPublicParamsWithTimeout(timeout time.Duration) *GetOAuth2ClientPublicParams { - return &GetOAuth2ClientPublicParams{ - timeout: timeout, - } -} - -// NewGetOAuth2ClientPublicParamsWithContext creates a new GetOAuth2ClientPublicParams object -// with the ability to set a context for a request. -func NewGetOAuth2ClientPublicParamsWithContext(ctx context.Context) *GetOAuth2ClientPublicParams { - return &GetOAuth2ClientPublicParams{ - Context: ctx, - } -} - -// NewGetOAuth2ClientPublicParamsWithHTTPClient creates a new GetOAuth2ClientPublicParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetOAuth2ClientPublicParamsWithHTTPClient(client *http.Client) *GetOAuth2ClientPublicParams { - return &GetOAuth2ClientPublicParams{ - HTTPClient: client, - } -} - -/* GetOAuth2ClientPublicParams contains all the parameters to send to the API endpoint - for the get o auth2 client public operation. - - Typically these are written to a http.Request. -*/ -type GetOAuth2ClientPublicParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get o auth2 client public params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetOAuth2ClientPublicParams) WithDefaults() *GetOAuth2ClientPublicParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get o auth2 client public params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetOAuth2ClientPublicParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get o auth2 client public params -func (o *GetOAuth2ClientPublicParams) WithTimeout(timeout time.Duration) *GetOAuth2ClientPublicParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get o auth2 client public params -func (o *GetOAuth2ClientPublicParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get o auth2 client public params -func (o *GetOAuth2ClientPublicParams) WithContext(ctx context.Context) *GetOAuth2ClientPublicParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get o auth2 client public params -func (o *GetOAuth2ClientPublicParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get o auth2 client public params -func (o *GetOAuth2ClientPublicParams) WithHTTPClient(client *http.Client) *GetOAuth2ClientPublicParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get o auth2 client public params -func (o *GetOAuth2ClientPublicParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetOAuth2ClientPublicParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/get_o_auth2_client_public_responses.go b/internal/httpclient/client/public/get_o_auth2_client_public_responses.go deleted file mode 100644 index 00993a7b47d..00000000000 --- a/internal/httpclient/client/public/get_o_auth2_client_public_responses.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// GetOAuth2ClientPublicReader is a Reader for the GetOAuth2ClientPublic structure. -type GetOAuth2ClientPublicReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetOAuth2ClientPublicReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetOAuth2ClientPublicOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetOAuth2ClientPublicUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetOAuth2ClientPublicInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetOAuth2ClientPublicOK creates a GetOAuth2ClientPublicOK with default headers values -func NewGetOAuth2ClientPublicOK() *GetOAuth2ClientPublicOK { - return &GetOAuth2ClientPublicOK{} -} - -/* GetOAuth2ClientPublicOK describes a response with status code 200, with default header values. - -oAuth2Client -*/ -type GetOAuth2ClientPublicOK struct { - Payload *models.OAuth2Client -} - -func (o *GetOAuth2ClientPublicOK) Error() string { - return fmt.Sprintf("[GET /connect/register][%d] getOAuth2ClientPublicOK %+v", 200, o.Payload) -} -func (o *GetOAuth2ClientPublicOK) GetPayload() *models.OAuth2Client { - return o.Payload -} - -func (o *GetOAuth2ClientPublicOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OAuth2Client) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetOAuth2ClientPublicUnauthorized creates a GetOAuth2ClientPublicUnauthorized with default headers values -func NewGetOAuth2ClientPublicUnauthorized() *GetOAuth2ClientPublicUnauthorized { - return &GetOAuth2ClientPublicUnauthorized{} -} - -/* GetOAuth2ClientPublicUnauthorized describes a response with status code 401, with default header values. - -genericError -*/ -type GetOAuth2ClientPublicUnauthorized struct { - Payload *models.GenericError -} - -func (o *GetOAuth2ClientPublicUnauthorized) Error() string { - return fmt.Sprintf("[GET /connect/register][%d] getOAuth2ClientPublicUnauthorized %+v", 401, o.Payload) -} -func (o *GetOAuth2ClientPublicUnauthorized) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *GetOAuth2ClientPublicUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetOAuth2ClientPublicInternalServerError creates a GetOAuth2ClientPublicInternalServerError with default headers values -func NewGetOAuth2ClientPublicInternalServerError() *GetOAuth2ClientPublicInternalServerError { - return &GetOAuth2ClientPublicInternalServerError{} -} - -/* GetOAuth2ClientPublicInternalServerError describes a response with status code 500, with default header values. - -genericError -*/ -type GetOAuth2ClientPublicInternalServerError struct { - Payload *models.GenericError -} - -func (o *GetOAuth2ClientPublicInternalServerError) Error() string { - return fmt.Sprintf("[GET /connect/register][%d] getOAuth2ClientPublicInternalServerError %+v", 500, o.Payload) -} -func (o *GetOAuth2ClientPublicInternalServerError) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *GetOAuth2ClientPublicInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/is_instance_ready_parameters.go b/internal/httpclient/client/public/is_instance_ready_parameters.go index 1d00d0188ae..b6ae09dcfd3 100644 --- a/internal/httpclient/client/public/is_instance_ready_parameters.go +++ b/internal/httpclient/client/public/is_instance_ready_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIsInstanceReadyParams creates a new IsInstanceReadyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewIsInstanceReadyParams creates a new IsInstanceReadyParams object +// with the default values initialized. func NewIsInstanceReadyParams() *IsInstanceReadyParams { + return &IsInstanceReadyParams{ + timeout: cr.DefaultTimeout, } } // NewIsInstanceReadyParamsWithTimeout creates a new IsInstanceReadyParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewIsInstanceReadyParamsWithTimeout(timeout time.Duration) *IsInstanceReadyParams { + return &IsInstanceReadyParams{ + timeout: timeout, } } // NewIsInstanceReadyParamsWithContext creates a new IsInstanceReadyParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewIsInstanceReadyParamsWithContext(ctx context.Context) *IsInstanceReadyParams { + return &IsInstanceReadyParams{ + Context: ctx, } } // NewIsInstanceReadyParamsWithHTTPClient creates a new IsInstanceReadyParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewIsInstanceReadyParamsWithHTTPClient(client *http.Client) *IsInstanceReadyParams { + return &IsInstanceReadyParams{ HTTPClient: client, } } -/* IsInstanceReadyParams contains all the parameters to send to the API endpoint - for the is instance ready operation. - - Typically these are written to a http.Request. +/*IsInstanceReadyParams contains all the parameters to send to the API endpoint +for the is instance ready operation typically these are written to a http.Request */ type IsInstanceReadyParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type IsInstanceReadyParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the is instance ready params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceReadyParams) WithDefaults() *IsInstanceReadyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the is instance ready params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceReadyParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the is instance ready params func (o *IsInstanceReadyParams) WithTimeout(timeout time.Duration) *IsInstanceReadyParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/is_instance_ready_responses.go b/internal/httpclient/client/public/is_instance_ready_responses.go index e09081bd45b..2739bb4c847 100644 --- a/internal/httpclient/client/public/is_instance_ready_responses.go +++ b/internal/httpclient/client/public/is_instance_ready_responses.go @@ -35,8 +35,9 @@ func (o *IsInstanceReadyReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewIsInstanceReadyOK() *IsInstanceReadyOK { return &IsInstanceReadyOK{} } -/* IsInstanceReadyOK describes a response with status code 200, with default header values. +/*IsInstanceReadyOK handles this case with default header values. healthStatus */ @@ -56,6 +57,7 @@ type IsInstanceReadyOK struct { func (o *IsInstanceReadyOK) Error() string { return fmt.Sprintf("[GET /health/ready][%d] isInstanceReadyOK %+v", 200, o.Payload) } + func (o *IsInstanceReadyOK) GetPayload() *models.HealthStatus { return o.Payload } @@ -77,7 +79,7 @@ func NewIsInstanceReadyServiceUnavailable() *IsInstanceReadyServiceUnavailable { return &IsInstanceReadyServiceUnavailable{} } -/* IsInstanceReadyServiceUnavailable describes a response with status code 503, with default header values. +/*IsInstanceReadyServiceUnavailable handles this case with default header values. healthNotReadyStatus */ @@ -88,6 +90,7 @@ type IsInstanceReadyServiceUnavailable struct { func (o *IsInstanceReadyServiceUnavailable) Error() string { return fmt.Sprintf("[GET /health/ready][%d] isInstanceReadyServiceUnavailable %+v", 503, o.Payload) } + func (o *IsInstanceReadyServiceUnavailable) GetPayload() *models.HealthNotReadyStatus { return o.Payload } diff --git a/internal/httpclient/client/public/oauth2_token_parameters.go b/internal/httpclient/client/public/oauth2_token_parameters.go index c67d2e921e3..6acc0424a20 100644 --- a/internal/httpclient/client/public/oauth2_token_parameters.go +++ b/internal/httpclient/client/public/oauth2_token_parameters.go @@ -16,62 +16,59 @@ import ( "github.com/go-openapi/strfmt" ) -// NewOauth2TokenParams creates a new Oauth2TokenParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewOauth2TokenParams creates a new Oauth2TokenParams object +// with the default values initialized. func NewOauth2TokenParams() *Oauth2TokenParams { + var () return &Oauth2TokenParams{ + timeout: cr.DefaultTimeout, } } // NewOauth2TokenParamsWithTimeout creates a new Oauth2TokenParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewOauth2TokenParamsWithTimeout(timeout time.Duration) *Oauth2TokenParams { + var () return &Oauth2TokenParams{ + timeout: timeout, } } // NewOauth2TokenParamsWithContext creates a new Oauth2TokenParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewOauth2TokenParamsWithContext(ctx context.Context) *Oauth2TokenParams { + var () return &Oauth2TokenParams{ + Context: ctx, } } // NewOauth2TokenParamsWithHTTPClient creates a new Oauth2TokenParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewOauth2TokenParamsWithHTTPClient(client *http.Client) *Oauth2TokenParams { + var () return &Oauth2TokenParams{ HTTPClient: client, } } -/* Oauth2TokenParams contains all the parameters to send to the API endpoint - for the oauth2 token operation. - - Typically these are written to a http.Request. +/*Oauth2TokenParams contains all the parameters to send to the API endpoint +for the oauth2 token operation typically these are written to a http.Request */ type Oauth2TokenParams struct { - // ClientID. + /*ClientID*/ ClientID *string - - // Code. + /*Code*/ Code *string - - // GrantType. + /*GrantType*/ GrantType string - - // RedirectURI. + /*RedirectURI*/ RedirectURI *string - - // RefreshToken. + /*RefreshToken*/ RefreshToken *string timeout time.Duration @@ -79,21 +76,6 @@ type Oauth2TokenParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the oauth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *Oauth2TokenParams) WithDefaults() *Oauth2TokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the oauth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *Oauth2TokenParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the oauth2 token params func (o *Oauth2TokenParams) WithTimeout(timeout time.Duration) *Oauth2TokenParams { o.SetTimeout(timeout) @@ -203,6 +185,7 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } + } if o.Code != nil { @@ -218,6 +201,7 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } + } // form param grant_type @@ -242,6 +226,7 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } + } if o.RefreshToken != nil { @@ -257,6 +242,7 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } + } if len(res) > 0 { diff --git a/internal/httpclient/client/public/oauth2_token_responses.go b/internal/httpclient/client/public/oauth2_token_responses.go index 72db050471a..1a0fe662680 100644 --- a/internal/httpclient/client/public/oauth2_token_responses.go +++ b/internal/httpclient/client/public/oauth2_token_responses.go @@ -47,8 +47,9 @@ func (o *Oauth2TokenReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewOauth2TokenOK() *Oauth2TokenOK { return &Oauth2TokenOK{} } -/* Oauth2TokenOK describes a response with status code 200, with default header values. +/*Oauth2TokenOK handles this case with default header values. oauth2TokenResponse */ @@ -68,6 +69,7 @@ type Oauth2TokenOK struct { func (o *Oauth2TokenOK) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenOK %+v", 200, o.Payload) } + func (o *Oauth2TokenOK) GetPayload() *models.Oauth2TokenResponse { return o.Payload } @@ -89,7 +91,7 @@ func NewOauth2TokenBadRequest() *Oauth2TokenBadRequest { return &Oauth2TokenBadRequest{} } -/* Oauth2TokenBadRequest describes a response with status code 400, with default header values. +/*Oauth2TokenBadRequest handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type Oauth2TokenBadRequest struct { func (o *Oauth2TokenBadRequest) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenBadRequest %+v", 400, o.Payload) } + func (o *Oauth2TokenBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewOauth2TokenUnauthorized() *Oauth2TokenUnauthorized { return &Oauth2TokenUnauthorized{} } -/* Oauth2TokenUnauthorized describes a response with status code 401, with default header values. +/*Oauth2TokenUnauthorized handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type Oauth2TokenUnauthorized struct { func (o *Oauth2TokenUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenUnauthorized %+v", 401, o.Payload) } + func (o *Oauth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewOauth2TokenInternalServerError() *Oauth2TokenInternalServerError { return &Oauth2TokenInternalServerError{} } -/* Oauth2TokenInternalServerError describes a response with status code 500, with default header values. +/*Oauth2TokenInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type Oauth2TokenInternalServerError struct { func (o *Oauth2TokenInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenInternalServerError %+v", 500, o.Payload) } + func (o *Oauth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/oauth_auth_parameters.go b/internal/httpclient/client/public/oauth_auth_parameters.go index 46f21005985..4476b6a7414 100644 --- a/internal/httpclient/client/public/oauth_auth_parameters.go +++ b/internal/httpclient/client/public/oauth_auth_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewOauthAuthParams creates a new OauthAuthParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewOauthAuthParams creates a new OauthAuthParams object +// with the default values initialized. func NewOauthAuthParams() *OauthAuthParams { + return &OauthAuthParams{ + timeout: cr.DefaultTimeout, } } // NewOauthAuthParamsWithTimeout creates a new OauthAuthParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewOauthAuthParamsWithTimeout(timeout time.Duration) *OauthAuthParams { + return &OauthAuthParams{ + timeout: timeout, } } // NewOauthAuthParamsWithContext creates a new OauthAuthParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewOauthAuthParamsWithContext(ctx context.Context) *OauthAuthParams { + return &OauthAuthParams{ + Context: ctx, } } // NewOauthAuthParamsWithHTTPClient creates a new OauthAuthParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewOauthAuthParamsWithHTTPClient(client *http.Client) *OauthAuthParams { + return &OauthAuthParams{ HTTPClient: client, } } -/* OauthAuthParams contains all the parameters to send to the API endpoint - for the oauth auth operation. - - Typically these are written to a http.Request. +/*OauthAuthParams contains all the parameters to send to the API endpoint +for the oauth auth operation typically these are written to a http.Request */ type OauthAuthParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type OauthAuthParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the oauth auth params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *OauthAuthParams) WithDefaults() *OauthAuthParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the oauth auth params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *OauthAuthParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the oauth auth params func (o *OauthAuthParams) WithTimeout(timeout time.Duration) *OauthAuthParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/oauth_auth_responses.go b/internal/httpclient/client/public/oauth_auth_responses.go index 7a0a3477b9d..ad4a379f4c2 100644 --- a/internal/httpclient/client/public/oauth_auth_responses.go +++ b/internal/httpclient/client/public/oauth_auth_responses.go @@ -41,8 +41,9 @@ func (o *OauthAuthReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewOauthAuthFound() *OauthAuthFound { return &OauthAuthFound{} } -/* OauthAuthFound describes a response with status code 302, with default header values. +/*OauthAuthFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type OauthAuthFound struct { @@ -73,7 +74,7 @@ func NewOauthAuthUnauthorized() *OauthAuthUnauthorized { return &OauthAuthUnauthorized{} } -/* OauthAuthUnauthorized describes a response with status code 401, with default header values. +/*OauthAuthUnauthorized handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type OauthAuthUnauthorized struct { func (o *OauthAuthUnauthorized) Error() string { return fmt.Sprintf("[GET /oauth2/auth][%d] oauthAuthUnauthorized %+v", 401, o.Payload) } + func (o *OauthAuthUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewOauthAuthInternalServerError() *OauthAuthInternalServerError { return &OauthAuthInternalServerError{} } -/* OauthAuthInternalServerError describes a response with status code 500, with default header values. +/*OauthAuthInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type OauthAuthInternalServerError struct { func (o *OauthAuthInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth][%d] oauthAuthInternalServerError %+v", 500, o.Payload) } + func (o *OauthAuthInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/public_client.go b/internal/httpclient/client/public/public_client.go index 31a6c56117c..d345aa70eab 100644 --- a/internal/httpclient/client/public/public_client.go +++ b/internal/httpclient/client/public/public_client.go @@ -25,122 +25,35 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - // ClientService is the interface for Client methods type ClientService interface { - CreateOAuth2ClientPublic(params *CreateOAuth2ClientPublicParams, opts ...ClientOption) (*CreateOAuth2ClientPublicCreated, error) + DisconnectUser(params *DisconnectUserParams) error - DeleteOAuth2ClientPublic(params *DeleteOAuth2ClientPublicParams, opts ...ClientOption) (*DeleteOAuth2ClientPublicNoContent, error) + DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams) (*DiscoverOpenIDConfigurationOK, error) - DisconnectUser(params *DisconnectUserParams, opts ...ClientOption) error + IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceReadyOK, error) - DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams, opts ...ClientOption) (*DiscoverOpenIDConfigurationOK, error) + Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*Oauth2TokenOK, error) - GetOAuth2ClientPublic(params *GetOAuth2ClientPublicParams, opts ...ClientOption) (*GetOAuth2ClientPublicOK, error) + OauthAuth(params *OauthAuthParams) error - IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOption) (*IsInstanceReadyOK, error) + RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeOAuth2TokenOK, error) - Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*Oauth2TokenOK, error) + SelfServiceCreateOAuth2Client(params *SelfServiceCreateOAuth2ClientParams) (*SelfServiceCreateOAuth2ClientCreated, error) - OauthAuth(params *OauthAuthParams, opts ...ClientOption) error + SelfServiceDeleteOAuth2Client(params *SelfServiceDeleteOAuth2ClientParams) (*SelfServiceDeleteOAuth2ClientNoContent, error) - RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeOAuth2TokenOK, error) + SelfServiceGetOAuth2Client(params *SelfServiceGetOAuth2ClientParams) (*SelfServiceGetOAuth2ClientOK, error) - UpdateOAuth2ClientPublic(params *UpdateOAuth2ClientPublicParams, opts ...ClientOption) (*UpdateOAuth2ClientPublicOK, error) + SelfServiceUpdateOAuth2Client(params *SelfServiceUpdateOAuth2ClientParams) (*SelfServiceUpdateOAuth2ClientOK, error) - Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UserinfoOK, error) + Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter) (*UserinfoOK, error) - WellKnown(params *WellKnownParams, opts ...ClientOption) (*WellKnownOK, error) + WellKnown(params *WellKnownParams) (*WellKnownOK, error) SetTransport(transport runtime.ClientTransport) } -/* - CreateOAuth2ClientPublic creates an o auth 2 0 client - - Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somewhere safe. - -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. -*/ -func (a *Client) CreateOAuth2ClientPublic(params *CreateOAuth2ClientPublicParams, opts ...ClientOption) (*CreateOAuth2ClientPublicCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateOAuth2ClientPublicParams() - } - op := &runtime.ClientOperation{ - ID: "createOAuth2ClientPublic", - Method: "POST", - PathPattern: "/connect/register", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &CreateOAuth2ClientPublicReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateOAuth2ClientPublicCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteOAuth2ClientPublic deletes an o auth 2 0 client - - Delete an existing OAuth 2.0 Client by its ID. - -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. -*/ -func (a *Client) DeleteOAuth2ClientPublic(params *DeleteOAuth2ClientPublicParams, opts ...ClientOption) (*DeleteOAuth2ClientPublicNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteOAuth2ClientPublicParams() - } - op := &runtime.ClientOperation{ - ID: "deleteOAuth2ClientPublic", - Method: "DELETE", - PathPattern: "/connect/register", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &DeleteOAuth2ClientPublicReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteOAuth2ClientPublicNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* DisconnectUser opens ID connect front backchannel enabled logout @@ -149,12 +62,13 @@ func (a *Client) DeleteOAuth2ClientPublic(params *DeleteOAuth2ClientPublicParams https://openid.net/specs/openid-connect-frontchannel-1_0.html https://openid.net/specs/openid-connect-backchannel-1_0.html */ -func (a *Client) DisconnectUser(params *DisconnectUserParams, opts ...ClientOption) error { +func (a *Client) DisconnectUser(params *DisconnectUserParams) error { // TODO: Validate the params before sending if params == nil { params = NewDisconnectUserParams() } - op := &runtime.ClientOperation{ + + _, err := a.transport.Submit(&runtime.ClientOperation{ ID: "disconnectUser", Method: "GET", PathPattern: "/oauth2/sessions/logout", @@ -165,12 +79,7 @@ func (a *Client) DisconnectUser(params *DisconnectUserParams, opts ...ClientOpti Reader: &DisconnectUserReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - _, err := a.transport.Submit(op) + }) if err != nil { return err } @@ -187,12 +96,13 @@ flow at https://openid.net/specs/openid-connect-discovery-1_0.html . Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang), and others. For a full list of clients go here: https://openid.net/developers/certified/ */ -func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams, opts ...ClientOption) (*DiscoverOpenIDConfigurationOK, error) { +func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams) (*DiscoverOpenIDConfigurationOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDiscoverOpenIDConfigurationParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "discoverOpenIDConfiguration", Method: "GET", PathPattern: "/.well-known/openid-configuration", @@ -203,12 +113,7 @@ func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfiguration Reader: &DiscoverOpenIDConfigurationReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -222,48 +127,6 @@ func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfiguration panic(msg) } -/* - GetOAuth2ClientPublic gets an o auth 2 0 client - - Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. - -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. -*/ -func (a *Client) GetOAuth2ClientPublic(params *GetOAuth2ClientPublicParams, opts ...ClientOption) (*GetOAuth2ClientPublicOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetOAuth2ClientPublicParams() - } - op := &runtime.ClientOperation{ - ID: "getOAuth2ClientPublic", - Method: "GET", - PathPattern: "/connect/register", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetOAuth2ClientPublicReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetOAuth2ClientPublicOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - /* IsInstanceReady checks readiness status @@ -276,12 +139,13 @@ If the service supports TLS Edge Termination, this endpoint does not require the Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance. */ -func (a *Client) IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOption) (*IsInstanceReadyOK, error) { +func (a *Client) IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceReadyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewIsInstanceReadyParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "isInstanceReady", Method: "GET", PathPattern: "/health/ready", @@ -292,12 +156,7 @@ func (a *Client) IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOp Reader: &IsInstanceReadyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -323,12 +182,13 @@ request entity-body. > > Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed above! */ -func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*Oauth2TokenOK, error) { +func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*Oauth2TokenOK, error) { // TODO: Validate the params before sending if params == nil { params = NewOauth2TokenParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "oauth2Token", Method: "POST", PathPattern: "/oauth2/token", @@ -340,12 +200,7 @@ func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientA AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -367,12 +222,13 @@ OAuth2 is a very popular protocol and a library for your programming language wi To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749 */ -func (a *Client) OauthAuth(params *OauthAuthParams, opts ...ClientOption) error { +func (a *Client) OauthAuth(params *OauthAuthParams) error { // TODO: Validate the params before sending if params == nil { params = NewOauthAuthParams() } - op := &runtime.ClientOperation{ + + _, err := a.transport.Submit(&runtime.ClientOperation{ ID: "oauthAuth", Method: "GET", PathPattern: "/oauth2/auth", @@ -383,12 +239,7 @@ func (a *Client) OauthAuth(params *OauthAuthParams, opts ...ClientOption) error Reader: &OauthAuthReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - _, err := a.transport.Submit(op) + }) if err != nil { return err } @@ -403,12 +254,13 @@ longer be used to make access requests, and a revoked refresh token can no longe Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for. */ -func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeOAuth2TokenOK, error) { +func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeOAuth2TokenOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRevokeOAuth2TokenParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "revokeOAuth2Token", Method: "POST", PathPattern: "/oauth2/revoke", @@ -420,12 +272,7 @@ func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo run AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -440,45 +287,183 @@ func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo run } /* - UpdateOAuth2ClientPublic updates an o auth 2 0 client + SelfServiceCreateOAuth2Client registers an o auth 2 0 client using open ID dynamic client registration - Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. + This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the +public internet directly and can be used in self-service. It implements the OpenID Connect +Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +is disabled by default. It can be enabled by an administrator. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected. +Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be +generated. The secret will be returned in the response and you will not be able to retrieve it later on. +Write the secret down and keep it somewhere safe. */ -func (a *Client) UpdateOAuth2ClientPublic(params *UpdateOAuth2ClientPublicParams, opts ...ClientOption) (*UpdateOAuth2ClientPublicOK, error) { +func (a *Client) SelfServiceCreateOAuth2Client(params *SelfServiceCreateOAuth2ClientParams) (*SelfServiceCreateOAuth2ClientCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewUpdateOAuth2ClientPublicParams() + params = NewSelfServiceCreateOAuth2ClientParams() } - op := &runtime.ClientOperation{ - ID: "updateOAuth2ClientPublic", - Method: "PUT", + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "selfServiceCreateOAuth2Client", + Method: "POST", PathPattern: "/connect/register", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &UpdateOAuth2ClientPublicReader{formats: a.formats}, + Reader: &SelfServiceCreateOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SelfServiceCreateOAuth2ClientCreated) + if ok { + return success, nil } - for _, opt := range opts { - opt(op) + // unexpected success response + unexpectedSuccess := result.(*SelfServiceCreateOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + SelfServiceDeleteOAuth2Client deletes an o auth 2 0 client using open ID dynamic client registration + + This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of facing the +public internet directly and can be used in self-service. It implements the OpenID Connect +Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +is disabled by default. It can be enabled by an administrator. + +To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client +uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. +If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. +*/ +func (a *Client) SelfServiceDeleteOAuth2Client(params *SelfServiceDeleteOAuth2ClientParams) (*SelfServiceDeleteOAuth2ClientNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSelfServiceDeleteOAuth2ClientParams() } - result, err := a.transport.Submit(op) + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "selfServiceDeleteOAuth2Client", + Method: "DELETE", + PathPattern: "/connect/register", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &SelfServiceDeleteOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) if err != nil { return nil, err } - success, ok := result.(*UpdateOAuth2ClientPublicOK) + success, ok := result.(*SelfServiceDeleteOAuth2ClientNoContent) if ok { return success, nil } // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateOAuth2ClientPublic: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + unexpectedSuccess := result.(*SelfServiceDeleteOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + SelfServiceGetOAuth2Client gets an o auth 2 0 client using open ID dynamic client registration + + This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the +public internet directly and can be used in self-service. It implements the OpenID Connect +Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +is disabled by default. It can be enabled by an administrator. + +To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client +uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. +If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. +*/ +func (a *Client) SelfServiceGetOAuth2Client(params *SelfServiceGetOAuth2ClientParams) (*SelfServiceGetOAuth2ClientOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSelfServiceGetOAuth2ClientParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "selfServiceGetOAuth2Client", + Method: "GET", + PathPattern: "/connect/register", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &SelfServiceGetOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SelfServiceGetOAuth2ClientOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SelfServiceGetOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + SelfServiceUpdateOAuth2Client updates an o auth 2 0 client using open ID dynamic client registration + + This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is capable of facing the +public internet directly and can be used in self-service. It implements the OpenID Connect +Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +is disabled by default. It can be enabled by an administrator. + +If you pass `client_secret` the secret will be updated and returned via the API. +This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. + +To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client +uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. +If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. +*/ +func (a *Client) SelfServiceUpdateOAuth2Client(params *SelfServiceUpdateOAuth2ClientParams) (*SelfServiceUpdateOAuth2ClientOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSelfServiceUpdateOAuth2ClientParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "selfServiceUpdateOAuth2Client", + Method: "PUT", + PathPattern: "/connect/register", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &SelfServiceUpdateOAuth2ClientReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*SelfServiceUpdateOAuth2ClientOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SelfServiceUpdateOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } /* @@ -493,12 +478,13 @@ In the case of authentication error, a WWW-Authenticate header might be set in t with more information about the error. See [the spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3) for more details about header format. */ -func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UserinfoOK, error) { +func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter) (*UserinfoOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUserinfoParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "userinfo", Method: "GET", PathPattern: "/userinfo", @@ -510,12 +496,7 @@ func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInf AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -536,12 +517,13 @@ func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInf if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like [node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others. */ -func (a *Client) WellKnown(params *WellKnownParams, opts ...ClientOption) (*WellKnownOK, error) { +func (a *Client) WellKnown(params *WellKnownParams) (*WellKnownOK, error) { // TODO: Validate the params before sending if params == nil { params = NewWellKnownParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "wellKnown", Method: "GET", PathPattern: "/.well-known/jwks.json", @@ -552,12 +534,7 @@ func (a *Client) WellKnown(params *WellKnownParams, opts ...ClientOption) (*Well Reader: &WellKnownReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } diff --git a/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go b/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go index 8a67b4b2903..782c6be73b8 100644 --- a/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go +++ b/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRevokeOAuth2TokenParams creates a new RevokeOAuth2TokenParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRevokeOAuth2TokenParams creates a new RevokeOAuth2TokenParams object +// with the default values initialized. func NewRevokeOAuth2TokenParams() *RevokeOAuth2TokenParams { + var () return &RevokeOAuth2TokenParams{ + timeout: cr.DefaultTimeout, } } // NewRevokeOAuth2TokenParamsWithTimeout creates a new RevokeOAuth2TokenParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRevokeOAuth2TokenParamsWithTimeout(timeout time.Duration) *RevokeOAuth2TokenParams { + var () return &RevokeOAuth2TokenParams{ + timeout: timeout, } } // NewRevokeOAuth2TokenParamsWithContext creates a new RevokeOAuth2TokenParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRevokeOAuth2TokenParamsWithContext(ctx context.Context) *RevokeOAuth2TokenParams { + var () return &RevokeOAuth2TokenParams{ + Context: ctx, } } // NewRevokeOAuth2TokenParamsWithHTTPClient creates a new RevokeOAuth2TokenParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRevokeOAuth2TokenParamsWithHTTPClient(client *http.Client) *RevokeOAuth2TokenParams { + var () return &RevokeOAuth2TokenParams{ HTTPClient: client, } } -/* RevokeOAuth2TokenParams contains all the parameters to send to the API endpoint - for the revoke o auth2 token operation. - - Typically these are written to a http.Request. +/*RevokeOAuth2TokenParams contains all the parameters to send to the API endpoint +for the revoke o auth2 token operation typically these are written to a http.Request */ type RevokeOAuth2TokenParams struct { - // Token. + /*Token*/ Token string timeout time.Duration @@ -67,21 +68,6 @@ type RevokeOAuth2TokenParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the revoke o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeOAuth2TokenParams) WithDefaults() *RevokeOAuth2TokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the revoke o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeOAuth2TokenParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the revoke o auth2 token params func (o *RevokeOAuth2TokenParams) WithTimeout(timeout time.Duration) *RevokeOAuth2TokenParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/revoke_o_auth2_token_responses.go b/internal/httpclient/client/public/revoke_o_auth2_token_responses.go index 3e34c0a0645..1e058d9b063 100644 --- a/internal/httpclient/client/public/revoke_o_auth2_token_responses.go +++ b/internal/httpclient/client/public/revoke_o_auth2_token_responses.go @@ -41,8 +41,9 @@ func (o *RevokeOAuth2TokenReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewRevokeOAuth2TokenOK() *RevokeOAuth2TokenOK { return &RevokeOAuth2TokenOK{} } -/* RevokeOAuth2TokenOK describes a response with status code 200, with default header values. +/*RevokeOAuth2TokenOK handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RevokeOAuth2TokenOK struct { @@ -73,7 +74,7 @@ func NewRevokeOAuth2TokenUnauthorized() *RevokeOAuth2TokenUnauthorized { return &RevokeOAuth2TokenUnauthorized{} } -/* RevokeOAuth2TokenUnauthorized describes a response with status code 401, with default header values. +/*RevokeOAuth2TokenUnauthorized handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type RevokeOAuth2TokenUnauthorized struct { func (o *RevokeOAuth2TokenUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/revoke][%d] revokeOAuth2TokenUnauthorized %+v", 401, o.Payload) } + func (o *RevokeOAuth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewRevokeOAuth2TokenInternalServerError() *RevokeOAuth2TokenInternalServerE return &RevokeOAuth2TokenInternalServerError{} } -/* RevokeOAuth2TokenInternalServerError describes a response with status code 500, with default header values. +/*RevokeOAuth2TokenInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type RevokeOAuth2TokenInternalServerError struct { func (o *RevokeOAuth2TokenInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/revoke][%d] revokeOAuth2TokenInternalServerError %+v", 500, o.Payload) } + func (o *RevokeOAuth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/self_service_create_o_auth2_client_parameters.go b/internal/httpclient/client/public/self_service_create_o_auth2_client_parameters.go new file mode 100644 index 00000000000..4a037f84298 --- /dev/null +++ b/internal/httpclient/client/public/self_service_create_o_auth2_client_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// NewSelfServiceCreateOAuth2ClientParams creates a new SelfServiceCreateOAuth2ClientParams object +// with the default values initialized. +func NewSelfServiceCreateOAuth2ClientParams() *SelfServiceCreateOAuth2ClientParams { + var () + return &SelfServiceCreateOAuth2ClientParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSelfServiceCreateOAuth2ClientParamsWithTimeout creates a new SelfServiceCreateOAuth2ClientParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSelfServiceCreateOAuth2ClientParamsWithTimeout(timeout time.Duration) *SelfServiceCreateOAuth2ClientParams { + var () + return &SelfServiceCreateOAuth2ClientParams{ + + timeout: timeout, + } +} + +// NewSelfServiceCreateOAuth2ClientParamsWithContext creates a new SelfServiceCreateOAuth2ClientParams object +// with the default values initialized, and the ability to set a context for a request +func NewSelfServiceCreateOAuth2ClientParamsWithContext(ctx context.Context) *SelfServiceCreateOAuth2ClientParams { + var () + return &SelfServiceCreateOAuth2ClientParams{ + + Context: ctx, + } +} + +// NewSelfServiceCreateOAuth2ClientParamsWithHTTPClient creates a new SelfServiceCreateOAuth2ClientParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSelfServiceCreateOAuth2ClientParamsWithHTTPClient(client *http.Client) *SelfServiceCreateOAuth2ClientParams { + var () + return &SelfServiceCreateOAuth2ClientParams{ + HTTPClient: client, + } +} + +/*SelfServiceCreateOAuth2ClientParams contains all the parameters to send to the API endpoint +for the self service create o auth2 client operation typically these are written to a http.Request +*/ +type SelfServiceCreateOAuth2ClientParams struct { + + /*Body*/ + Body *models.OAuth2Client + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the self service create o auth2 client params +func (o *SelfServiceCreateOAuth2ClientParams) WithTimeout(timeout time.Duration) *SelfServiceCreateOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the self service create o auth2 client params +func (o *SelfServiceCreateOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the self service create o auth2 client params +func (o *SelfServiceCreateOAuth2ClientParams) WithContext(ctx context.Context) *SelfServiceCreateOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the self service create o auth2 client params +func (o *SelfServiceCreateOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the self service create o auth2 client params +func (o *SelfServiceCreateOAuth2ClientParams) WithHTTPClient(client *http.Client) *SelfServiceCreateOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the self service create o auth2 client params +func (o *SelfServiceCreateOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the self service create o auth2 client params +func (o *SelfServiceCreateOAuth2ClientParams) WithBody(body *models.OAuth2Client) *SelfServiceCreateOAuth2ClientParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the self service create o auth2 client params +func (o *SelfServiceCreateOAuth2ClientParams) SetBody(body *models.OAuth2Client) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *SelfServiceCreateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/self_service_create_o_auth2_client_responses.go b/internal/httpclient/client/public/self_service_create_o_auth2_client_responses.go new file mode 100644 index 00000000000..000e9c4dd5d --- /dev/null +++ b/internal/httpclient/client/public/self_service_create_o_auth2_client_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// SelfServiceCreateOAuth2ClientReader is a Reader for the SelfServiceCreateOAuth2Client structure. +type SelfServiceCreateOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SelfServiceCreateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewSelfServiceCreateOAuth2ClientCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSelfServiceCreateOAuth2ClientDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSelfServiceCreateOAuth2ClientCreated creates a SelfServiceCreateOAuth2ClientCreated with default headers values +func NewSelfServiceCreateOAuth2ClientCreated() *SelfServiceCreateOAuth2ClientCreated { + return &SelfServiceCreateOAuth2ClientCreated{} +} + +/*SelfServiceCreateOAuth2ClientCreated handles this case with default header values. + +oAuth2Client +*/ +type SelfServiceCreateOAuth2ClientCreated struct { + Payload *models.OAuth2Client +} + +func (o *SelfServiceCreateOAuth2ClientCreated) Error() string { + return fmt.Sprintf("[POST /connect/register][%d] selfServiceCreateOAuth2ClientCreated %+v", 201, o.Payload) +} + +func (o *SelfServiceCreateOAuth2ClientCreated) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *SelfServiceCreateOAuth2ClientCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSelfServiceCreateOAuth2ClientDefault creates a SelfServiceCreateOAuth2ClientDefault with default headers values +func NewSelfServiceCreateOAuth2ClientDefault(code int) *SelfServiceCreateOAuth2ClientDefault { + return &SelfServiceCreateOAuth2ClientDefault{ + _statusCode: code, + } +} + +/*SelfServiceCreateOAuth2ClientDefault handles this case with default header values. + +jsonError +*/ +type SelfServiceCreateOAuth2ClientDefault struct { + _statusCode int + + Payload *models.JSONError +} + +// Code gets the status code for the self service create o auth2 client default response +func (o *SelfServiceCreateOAuth2ClientDefault) Code() int { + return o._statusCode +} + +func (o *SelfServiceCreateOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[POST /connect/register][%d] selfServiceCreateOAuth2Client default %+v", o._statusCode, o.Payload) +} + +func (o *SelfServiceCreateOAuth2ClientDefault) GetPayload() *models.JSONError { + return o.Payload +} + +func (o *SelfServiceCreateOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JSONError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/self_service_delete_o_auth2_client_parameters.go b/internal/httpclient/client/public/self_service_delete_o_auth2_client_parameters.go new file mode 100644 index 00000000000..b4411577658 --- /dev/null +++ b/internal/httpclient/client/public/self_service_delete_o_auth2_client_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSelfServiceDeleteOAuth2ClientParams creates a new SelfServiceDeleteOAuth2ClientParams object +// with the default values initialized. +func NewSelfServiceDeleteOAuth2ClientParams() *SelfServiceDeleteOAuth2ClientParams { + var () + return &SelfServiceDeleteOAuth2ClientParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSelfServiceDeleteOAuth2ClientParamsWithTimeout creates a new SelfServiceDeleteOAuth2ClientParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSelfServiceDeleteOAuth2ClientParamsWithTimeout(timeout time.Duration) *SelfServiceDeleteOAuth2ClientParams { + var () + return &SelfServiceDeleteOAuth2ClientParams{ + + timeout: timeout, + } +} + +// NewSelfServiceDeleteOAuth2ClientParamsWithContext creates a new SelfServiceDeleteOAuth2ClientParams object +// with the default values initialized, and the ability to set a context for a request +func NewSelfServiceDeleteOAuth2ClientParamsWithContext(ctx context.Context) *SelfServiceDeleteOAuth2ClientParams { + var () + return &SelfServiceDeleteOAuth2ClientParams{ + + Context: ctx, + } +} + +// NewSelfServiceDeleteOAuth2ClientParamsWithHTTPClient creates a new SelfServiceDeleteOAuth2ClientParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSelfServiceDeleteOAuth2ClientParamsWithHTTPClient(client *http.Client) *SelfServiceDeleteOAuth2ClientParams { + var () + return &SelfServiceDeleteOAuth2ClientParams{ + HTTPClient: client, + } +} + +/*SelfServiceDeleteOAuth2ClientParams contains all the parameters to send to the API endpoint +for the self service delete o auth2 client operation typically these are written to a http.Request +*/ +type SelfServiceDeleteOAuth2ClientParams struct { + + /*ClientID*/ + ClientID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the self service delete o auth2 client params +func (o *SelfServiceDeleteOAuth2ClientParams) WithTimeout(timeout time.Duration) *SelfServiceDeleteOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the self service delete o auth2 client params +func (o *SelfServiceDeleteOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the self service delete o auth2 client params +func (o *SelfServiceDeleteOAuth2ClientParams) WithContext(ctx context.Context) *SelfServiceDeleteOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the self service delete o auth2 client params +func (o *SelfServiceDeleteOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the self service delete o auth2 client params +func (o *SelfServiceDeleteOAuth2ClientParams) WithHTTPClient(client *http.Client) *SelfServiceDeleteOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the self service delete o auth2 client params +func (o *SelfServiceDeleteOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithClientID adds the clientID to the self service delete o auth2 client params +func (o *SelfServiceDeleteOAuth2ClientParams) WithClientID(clientID string) *SelfServiceDeleteOAuth2ClientParams { + o.SetClientID(clientID) + return o +} + +// SetClientID adds the clientId to the self service delete o auth2 client params +func (o *SelfServiceDeleteOAuth2ClientParams) SetClientID(clientID string) { + o.ClientID = clientID +} + +// WriteToRequest writes these params to a swagger request +func (o *SelfServiceDeleteOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param client_id + qrClientID := o.ClientID + qClientID := qrClientID + if qClientID != "" { + if err := r.SetQueryParam("client_id", qClientID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/self_service_delete_o_auth2_client_responses.go b/internal/httpclient/client/public/self_service_delete_o_auth2_client_responses.go new file mode 100644 index 00000000000..77880ff208d --- /dev/null +++ b/internal/httpclient/client/public/self_service_delete_o_auth2_client_responses.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// SelfServiceDeleteOAuth2ClientReader is a Reader for the SelfServiceDeleteOAuth2Client structure. +type SelfServiceDeleteOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SelfServiceDeleteOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewSelfServiceDeleteOAuth2ClientNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSelfServiceDeleteOAuth2ClientDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSelfServiceDeleteOAuth2ClientNoContent creates a SelfServiceDeleteOAuth2ClientNoContent with default headers values +func NewSelfServiceDeleteOAuth2ClientNoContent() *SelfServiceDeleteOAuth2ClientNoContent { + return &SelfServiceDeleteOAuth2ClientNoContent{} +} + +/*SelfServiceDeleteOAuth2ClientNoContent handles this case with default header values. + +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +typically 201. +*/ +type SelfServiceDeleteOAuth2ClientNoContent struct { +} + +func (o *SelfServiceDeleteOAuth2ClientNoContent) Error() string { + return fmt.Sprintf("[DELETE /connect/register][%d] selfServiceDeleteOAuth2ClientNoContent ", 204) +} + +func (o *SelfServiceDeleteOAuth2ClientNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewSelfServiceDeleteOAuth2ClientDefault creates a SelfServiceDeleteOAuth2ClientDefault with default headers values +func NewSelfServiceDeleteOAuth2ClientDefault(code int) *SelfServiceDeleteOAuth2ClientDefault { + return &SelfServiceDeleteOAuth2ClientDefault{ + _statusCode: code, + } +} + +/*SelfServiceDeleteOAuth2ClientDefault handles this case with default header values. + +jsonError +*/ +type SelfServiceDeleteOAuth2ClientDefault struct { + _statusCode int + + Payload *models.JSONError +} + +// Code gets the status code for the self service delete o auth2 client default response +func (o *SelfServiceDeleteOAuth2ClientDefault) Code() int { + return o._statusCode +} + +func (o *SelfServiceDeleteOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[DELETE /connect/register][%d] selfServiceDeleteOAuth2Client default %+v", o._statusCode, o.Payload) +} + +func (o *SelfServiceDeleteOAuth2ClientDefault) GetPayload() *models.JSONError { + return o.Payload +} + +func (o *SelfServiceDeleteOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JSONError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/self_service_get_o_auth2_client_parameters.go b/internal/httpclient/client/public/self_service_get_o_auth2_client_parameters.go new file mode 100644 index 00000000000..94f81df3178 --- /dev/null +++ b/internal/httpclient/client/public/self_service_get_o_auth2_client_parameters.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewSelfServiceGetOAuth2ClientParams creates a new SelfServiceGetOAuth2ClientParams object +// with the default values initialized. +func NewSelfServiceGetOAuth2ClientParams() *SelfServiceGetOAuth2ClientParams { + + return &SelfServiceGetOAuth2ClientParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSelfServiceGetOAuth2ClientParamsWithTimeout creates a new SelfServiceGetOAuth2ClientParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSelfServiceGetOAuth2ClientParamsWithTimeout(timeout time.Duration) *SelfServiceGetOAuth2ClientParams { + + return &SelfServiceGetOAuth2ClientParams{ + + timeout: timeout, + } +} + +// NewSelfServiceGetOAuth2ClientParamsWithContext creates a new SelfServiceGetOAuth2ClientParams object +// with the default values initialized, and the ability to set a context for a request +func NewSelfServiceGetOAuth2ClientParamsWithContext(ctx context.Context) *SelfServiceGetOAuth2ClientParams { + + return &SelfServiceGetOAuth2ClientParams{ + + Context: ctx, + } +} + +// NewSelfServiceGetOAuth2ClientParamsWithHTTPClient creates a new SelfServiceGetOAuth2ClientParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSelfServiceGetOAuth2ClientParamsWithHTTPClient(client *http.Client) *SelfServiceGetOAuth2ClientParams { + + return &SelfServiceGetOAuth2ClientParams{ + HTTPClient: client, + } +} + +/*SelfServiceGetOAuth2ClientParams contains all the parameters to send to the API endpoint +for the self service get o auth2 client operation typically these are written to a http.Request +*/ +type SelfServiceGetOAuth2ClientParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the self service get o auth2 client params +func (o *SelfServiceGetOAuth2ClientParams) WithTimeout(timeout time.Duration) *SelfServiceGetOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the self service get o auth2 client params +func (o *SelfServiceGetOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the self service get o auth2 client params +func (o *SelfServiceGetOAuth2ClientParams) WithContext(ctx context.Context) *SelfServiceGetOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the self service get o auth2 client params +func (o *SelfServiceGetOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the self service get o auth2 client params +func (o *SelfServiceGetOAuth2ClientParams) WithHTTPClient(client *http.Client) *SelfServiceGetOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the self service get o auth2 client params +func (o *SelfServiceGetOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *SelfServiceGetOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/self_service_get_o_auth2_client_responses.go b/internal/httpclient/client/public/self_service_get_o_auth2_client_responses.go new file mode 100644 index 00000000000..116b8dd70e0 --- /dev/null +++ b/internal/httpclient/client/public/self_service_get_o_auth2_client_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// SelfServiceGetOAuth2ClientReader is a Reader for the SelfServiceGetOAuth2Client structure. +type SelfServiceGetOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SelfServiceGetOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSelfServiceGetOAuth2ClientOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSelfServiceGetOAuth2ClientDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSelfServiceGetOAuth2ClientOK creates a SelfServiceGetOAuth2ClientOK with default headers values +func NewSelfServiceGetOAuth2ClientOK() *SelfServiceGetOAuth2ClientOK { + return &SelfServiceGetOAuth2ClientOK{} +} + +/*SelfServiceGetOAuth2ClientOK handles this case with default header values. + +oAuth2Client +*/ +type SelfServiceGetOAuth2ClientOK struct { + Payload *models.OAuth2Client +} + +func (o *SelfServiceGetOAuth2ClientOK) Error() string { + return fmt.Sprintf("[GET /connect/register][%d] selfServiceGetOAuth2ClientOK %+v", 200, o.Payload) +} + +func (o *SelfServiceGetOAuth2ClientOK) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *SelfServiceGetOAuth2ClientOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSelfServiceGetOAuth2ClientDefault creates a SelfServiceGetOAuth2ClientDefault with default headers values +func NewSelfServiceGetOAuth2ClientDefault(code int) *SelfServiceGetOAuth2ClientDefault { + return &SelfServiceGetOAuth2ClientDefault{ + _statusCode: code, + } +} + +/*SelfServiceGetOAuth2ClientDefault handles this case with default header values. + +jsonError +*/ +type SelfServiceGetOAuth2ClientDefault struct { + _statusCode int + + Payload *models.JSONError +} + +// Code gets the status code for the self service get o auth2 client default response +func (o *SelfServiceGetOAuth2ClientDefault) Code() int { + return o._statusCode +} + +func (o *SelfServiceGetOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[GET /connect/register][%d] selfServiceGetOAuth2Client default %+v", o._statusCode, o.Payload) +} + +func (o *SelfServiceGetOAuth2ClientDefault) GetPayload() *models.JSONError { + return o.Payload +} + +func (o *SelfServiceGetOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JSONError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/self_service_update_o_auth2_client_parameters.go b/internal/httpclient/client/public/self_service_update_o_auth2_client_parameters.go new file mode 100644 index 00000000000..39ff3fc29c9 --- /dev/null +++ b/internal/httpclient/client/public/self_service_update_o_auth2_client_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// NewSelfServiceUpdateOAuth2ClientParams creates a new SelfServiceUpdateOAuth2ClientParams object +// with the default values initialized. +func NewSelfServiceUpdateOAuth2ClientParams() *SelfServiceUpdateOAuth2ClientParams { + var () + return &SelfServiceUpdateOAuth2ClientParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSelfServiceUpdateOAuth2ClientParamsWithTimeout creates a new SelfServiceUpdateOAuth2ClientParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSelfServiceUpdateOAuth2ClientParamsWithTimeout(timeout time.Duration) *SelfServiceUpdateOAuth2ClientParams { + var () + return &SelfServiceUpdateOAuth2ClientParams{ + + timeout: timeout, + } +} + +// NewSelfServiceUpdateOAuth2ClientParamsWithContext creates a new SelfServiceUpdateOAuth2ClientParams object +// with the default values initialized, and the ability to set a context for a request +func NewSelfServiceUpdateOAuth2ClientParamsWithContext(ctx context.Context) *SelfServiceUpdateOAuth2ClientParams { + var () + return &SelfServiceUpdateOAuth2ClientParams{ + + Context: ctx, + } +} + +// NewSelfServiceUpdateOAuth2ClientParamsWithHTTPClient creates a new SelfServiceUpdateOAuth2ClientParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSelfServiceUpdateOAuth2ClientParamsWithHTTPClient(client *http.Client) *SelfServiceUpdateOAuth2ClientParams { + var () + return &SelfServiceUpdateOAuth2ClientParams{ + HTTPClient: client, + } +} + +/*SelfServiceUpdateOAuth2ClientParams contains all the parameters to send to the API endpoint +for the self service update o auth2 client operation typically these are written to a http.Request +*/ +type SelfServiceUpdateOAuth2ClientParams struct { + + /*Body*/ + Body *models.OAuth2Client + /*ClientID*/ + ClientID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the self service update o auth2 client params +func (o *SelfServiceUpdateOAuth2ClientParams) WithTimeout(timeout time.Duration) *SelfServiceUpdateOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the self service update o auth2 client params +func (o *SelfServiceUpdateOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the self service update o auth2 client params +func (o *SelfServiceUpdateOAuth2ClientParams) WithContext(ctx context.Context) *SelfServiceUpdateOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the self service update o auth2 client params +func (o *SelfServiceUpdateOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the self service update o auth2 client params +func (o *SelfServiceUpdateOAuth2ClientParams) WithHTTPClient(client *http.Client) *SelfServiceUpdateOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the self service update o auth2 client params +func (o *SelfServiceUpdateOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the self service update o auth2 client params +func (o *SelfServiceUpdateOAuth2ClientParams) WithBody(body *models.OAuth2Client) *SelfServiceUpdateOAuth2ClientParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the self service update o auth2 client params +func (o *SelfServiceUpdateOAuth2ClientParams) SetBody(body *models.OAuth2Client) { + o.Body = body +} + +// WithClientID adds the clientID to the self service update o auth2 client params +func (o *SelfServiceUpdateOAuth2ClientParams) WithClientID(clientID string) *SelfServiceUpdateOAuth2ClientParams { + o.SetClientID(clientID) + return o +} + +// SetClientID adds the clientId to the self service update o auth2 client params +func (o *SelfServiceUpdateOAuth2ClientParams) SetClientID(clientID string) { + o.ClientID = clientID +} + +// WriteToRequest writes these params to a swagger request +func (o *SelfServiceUpdateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // query param client_id + qrClientID := o.ClientID + qClientID := qrClientID + if qClientID != "" { + if err := r.SetQueryParam("client_id", qClientID); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/self_service_update_o_auth2_client_responses.go b/internal/httpclient/client/public/self_service_update_o_auth2_client_responses.go new file mode 100644 index 00000000000..6e443fca5c3 --- /dev/null +++ b/internal/httpclient/client/public/self_service_update_o_auth2_client_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// SelfServiceUpdateOAuth2ClientReader is a Reader for the SelfServiceUpdateOAuth2Client structure. +type SelfServiceUpdateOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SelfServiceUpdateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSelfServiceUpdateOAuth2ClientOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSelfServiceUpdateOAuth2ClientDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSelfServiceUpdateOAuth2ClientOK creates a SelfServiceUpdateOAuth2ClientOK with default headers values +func NewSelfServiceUpdateOAuth2ClientOK() *SelfServiceUpdateOAuth2ClientOK { + return &SelfServiceUpdateOAuth2ClientOK{} +} + +/*SelfServiceUpdateOAuth2ClientOK handles this case with default header values. + +oAuth2Client +*/ +type SelfServiceUpdateOAuth2ClientOK struct { + Payload *models.OAuth2Client +} + +func (o *SelfServiceUpdateOAuth2ClientOK) Error() string { + return fmt.Sprintf("[PUT /connect/register][%d] selfServiceUpdateOAuth2ClientOK %+v", 200, o.Payload) +} + +func (o *SelfServiceUpdateOAuth2ClientOK) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *SelfServiceUpdateOAuth2ClientOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSelfServiceUpdateOAuth2ClientDefault creates a SelfServiceUpdateOAuth2ClientDefault with default headers values +func NewSelfServiceUpdateOAuth2ClientDefault(code int) *SelfServiceUpdateOAuth2ClientDefault { + return &SelfServiceUpdateOAuth2ClientDefault{ + _statusCode: code, + } +} + +/*SelfServiceUpdateOAuth2ClientDefault handles this case with default header values. + +jsonError +*/ +type SelfServiceUpdateOAuth2ClientDefault struct { + _statusCode int + + Payload *models.JSONError +} + +// Code gets the status code for the self service update o auth2 client default response +func (o *SelfServiceUpdateOAuth2ClientDefault) Code() int { + return o._statusCode +} + +func (o *SelfServiceUpdateOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[PUT /connect/register][%d] selfServiceUpdateOAuth2Client default %+v", o._statusCode, o.Payload) +} + +func (o *SelfServiceUpdateOAuth2ClientDefault) GetPayload() *models.JSONError { + return o.Payload +} + +func (o *SelfServiceUpdateOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JSONError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/update_o_auth2_client_public_parameters.go b/internal/httpclient/client/public/update_o_auth2_client_public_parameters.go deleted file mode 100644 index 04a8287b8e6..00000000000 --- a/internal/httpclient/client/public/update_o_auth2_client_public_parameters.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewUpdateOAuth2ClientPublicParams creates a new UpdateOAuth2ClientPublicParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateOAuth2ClientPublicParams() *UpdateOAuth2ClientPublicParams { - return &UpdateOAuth2ClientPublicParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateOAuth2ClientPublicParamsWithTimeout creates a new UpdateOAuth2ClientPublicParams object -// with the ability to set a timeout on a request. -func NewUpdateOAuth2ClientPublicParamsWithTimeout(timeout time.Duration) *UpdateOAuth2ClientPublicParams { - return &UpdateOAuth2ClientPublicParams{ - timeout: timeout, - } -} - -// NewUpdateOAuth2ClientPublicParamsWithContext creates a new UpdateOAuth2ClientPublicParams object -// with the ability to set a context for a request. -func NewUpdateOAuth2ClientPublicParamsWithContext(ctx context.Context) *UpdateOAuth2ClientPublicParams { - return &UpdateOAuth2ClientPublicParams{ - Context: ctx, - } -} - -// NewUpdateOAuth2ClientPublicParamsWithHTTPClient creates a new UpdateOAuth2ClientPublicParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateOAuth2ClientPublicParamsWithHTTPClient(client *http.Client) *UpdateOAuth2ClientPublicParams { - return &UpdateOAuth2ClientPublicParams{ - HTTPClient: client, - } -} - -/* UpdateOAuth2ClientPublicParams contains all the parameters to send to the API endpoint - for the update o auth2 client public operation. - - Typically these are written to a http.Request. -*/ -type UpdateOAuth2ClientPublicParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update o auth2 client public params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateOAuth2ClientPublicParams) WithDefaults() *UpdateOAuth2ClientPublicParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update o auth2 client public params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateOAuth2ClientPublicParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update o auth2 client public params -func (o *UpdateOAuth2ClientPublicParams) WithTimeout(timeout time.Duration) *UpdateOAuth2ClientPublicParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update o auth2 client public params -func (o *UpdateOAuth2ClientPublicParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update o auth2 client public params -func (o *UpdateOAuth2ClientPublicParams) WithContext(ctx context.Context) *UpdateOAuth2ClientPublicParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update o auth2 client public params -func (o *UpdateOAuth2ClientPublicParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update o auth2 client public params -func (o *UpdateOAuth2ClientPublicParams) WithHTTPClient(client *http.Client) *UpdateOAuth2ClientPublicParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update o auth2 client public params -func (o *UpdateOAuth2ClientPublicParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateOAuth2ClientPublicParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/update_o_auth2_client_public_responses.go b/internal/httpclient/client/public/update_o_auth2_client_public_responses.go deleted file mode 100644 index 822c0c1cfd4..00000000000 --- a/internal/httpclient/client/public/update_o_auth2_client_public_responses.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// UpdateOAuth2ClientPublicReader is a Reader for the UpdateOAuth2ClientPublic structure. -type UpdateOAuth2ClientPublicReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateOAuth2ClientPublicReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateOAuth2ClientPublicOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 500: - result := NewUpdateOAuth2ClientPublicInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateOAuth2ClientPublicOK creates a UpdateOAuth2ClientPublicOK with default headers values -func NewUpdateOAuth2ClientPublicOK() *UpdateOAuth2ClientPublicOK { - return &UpdateOAuth2ClientPublicOK{} -} - -/* UpdateOAuth2ClientPublicOK describes a response with status code 200, with default header values. - -oAuth2Client -*/ -type UpdateOAuth2ClientPublicOK struct { - Payload *models.OAuth2Client -} - -func (o *UpdateOAuth2ClientPublicOK) Error() string { - return fmt.Sprintf("[PUT /connect/register][%d] updateOAuth2ClientPublicOK %+v", 200, o.Payload) -} -func (o *UpdateOAuth2ClientPublicOK) GetPayload() *models.OAuth2Client { - return o.Payload -} - -func (o *UpdateOAuth2ClientPublicOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OAuth2Client) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateOAuth2ClientPublicInternalServerError creates a UpdateOAuth2ClientPublicInternalServerError with default headers values -func NewUpdateOAuth2ClientPublicInternalServerError() *UpdateOAuth2ClientPublicInternalServerError { - return &UpdateOAuth2ClientPublicInternalServerError{} -} - -/* UpdateOAuth2ClientPublicInternalServerError describes a response with status code 500, with default header values. - -genericError -*/ -type UpdateOAuth2ClientPublicInternalServerError struct { - Payload *models.GenericError -} - -func (o *UpdateOAuth2ClientPublicInternalServerError) Error() string { - return fmt.Sprintf("[PUT /connect/register][%d] updateOAuth2ClientPublicInternalServerError %+v", 500, o.Payload) -} -func (o *UpdateOAuth2ClientPublicInternalServerError) GetPayload() *models.GenericError { - return o.Payload -} - -func (o *UpdateOAuth2ClientPublicInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GenericError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/userinfo_parameters.go b/internal/httpclient/client/public/userinfo_parameters.go index 03b3ad50f4b..f9028b8ec43 100644 --- a/internal/httpclient/client/public/userinfo_parameters.go +++ b/internal/httpclient/client/public/userinfo_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUserinfoParams creates a new UserinfoParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewUserinfoParams creates a new UserinfoParams object +// with the default values initialized. func NewUserinfoParams() *UserinfoParams { + return &UserinfoParams{ + timeout: cr.DefaultTimeout, } } // NewUserinfoParamsWithTimeout creates a new UserinfoParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewUserinfoParamsWithTimeout(timeout time.Duration) *UserinfoParams { + return &UserinfoParams{ + timeout: timeout, } } // NewUserinfoParamsWithContext creates a new UserinfoParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewUserinfoParamsWithContext(ctx context.Context) *UserinfoParams { + return &UserinfoParams{ + Context: ctx, } } // NewUserinfoParamsWithHTTPClient creates a new UserinfoParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewUserinfoParamsWithHTTPClient(client *http.Client) *UserinfoParams { + return &UserinfoParams{ HTTPClient: client, } } -/* UserinfoParams contains all the parameters to send to the API endpoint - for the userinfo operation. - - Typically these are written to a http.Request. +/*UserinfoParams contains all the parameters to send to the API endpoint +for the userinfo operation typically these are written to a http.Request */ type UserinfoParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type UserinfoParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the userinfo params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UserinfoParams) WithDefaults() *UserinfoParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the userinfo params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UserinfoParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the userinfo params func (o *UserinfoParams) WithTimeout(timeout time.Duration) *UserinfoParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/userinfo_responses.go b/internal/httpclient/client/public/userinfo_responses.go index 7a7f9cd033b..14a27428726 100644 --- a/internal/httpclient/client/public/userinfo_responses.go +++ b/internal/httpclient/client/public/userinfo_responses.go @@ -41,8 +41,9 @@ func (o *UserinfoReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewUserinfoOK() *UserinfoOK { return &UserinfoOK{} } -/* UserinfoOK describes a response with status code 200, with default header values. +/*UserinfoOK handles this case with default header values. userinfoResponse */ @@ -62,6 +63,7 @@ type UserinfoOK struct { func (o *UserinfoOK) Error() string { return fmt.Sprintf("[GET /userinfo][%d] userinfoOK %+v", 200, o.Payload) } + func (o *UserinfoOK) GetPayload() *models.UserinfoResponse { return o.Payload } @@ -83,7 +85,7 @@ func NewUserinfoUnauthorized() *UserinfoUnauthorized { return &UserinfoUnauthorized{} } -/* UserinfoUnauthorized describes a response with status code 401, with default header values. +/*UserinfoUnauthorized handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type UserinfoUnauthorized struct { func (o *UserinfoUnauthorized) Error() string { return fmt.Sprintf("[GET /userinfo][%d] userinfoUnauthorized %+v", 401, o.Payload) } + func (o *UserinfoUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewUserinfoInternalServerError() *UserinfoInternalServerError { return &UserinfoInternalServerError{} } -/* UserinfoInternalServerError describes a response with status code 500, with default header values. +/*UserinfoInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type UserinfoInternalServerError struct { func (o *UserinfoInternalServerError) Error() string { return fmt.Sprintf("[GET /userinfo][%d] userinfoInternalServerError %+v", 500, o.Payload) } + func (o *UserinfoInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/well_known_parameters.go b/internal/httpclient/client/public/well_known_parameters.go index b9b34518e5b..206f42be2d7 100644 --- a/internal/httpclient/client/public/well_known_parameters.go +++ b/internal/httpclient/client/public/well_known_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewWellKnownParams creates a new WellKnownParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewWellKnownParams creates a new WellKnownParams object +// with the default values initialized. func NewWellKnownParams() *WellKnownParams { + return &WellKnownParams{ + timeout: cr.DefaultTimeout, } } // NewWellKnownParamsWithTimeout creates a new WellKnownParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewWellKnownParamsWithTimeout(timeout time.Duration) *WellKnownParams { + return &WellKnownParams{ + timeout: timeout, } } // NewWellKnownParamsWithContext creates a new WellKnownParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewWellKnownParamsWithContext(ctx context.Context) *WellKnownParams { + return &WellKnownParams{ + Context: ctx, } } // NewWellKnownParamsWithHTTPClient creates a new WellKnownParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewWellKnownParamsWithHTTPClient(client *http.Client) *WellKnownParams { + return &WellKnownParams{ HTTPClient: client, } } -/* WellKnownParams contains all the parameters to send to the API endpoint - for the well known operation. - - Typically these are written to a http.Request. +/*WellKnownParams contains all the parameters to send to the API endpoint +for the well known operation typically these are written to a http.Request */ type WellKnownParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type WellKnownParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the well known params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *WellKnownParams) WithDefaults() *WellKnownParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the well known params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *WellKnownParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the well known params func (o *WellKnownParams) WithTimeout(timeout time.Duration) *WellKnownParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/well_known_responses.go b/internal/httpclient/client/public/well_known_responses.go index 2d0a35e587c..8182a40c516 100644 --- a/internal/httpclient/client/public/well_known_responses.go +++ b/internal/httpclient/client/public/well_known_responses.go @@ -35,8 +35,9 @@ func (o *WellKnownReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewWellKnownOK() *WellKnownOK { return &WellKnownOK{} } -/* WellKnownOK describes a response with status code 200, with default header values. +/*WellKnownOK handles this case with default header values. JSONWebKeySet */ @@ -56,6 +57,7 @@ type WellKnownOK struct { func (o *WellKnownOK) Error() string { return fmt.Sprintf("[GET /.well-known/jwks.json][%d] wellKnownOK %+v", 200, o.Payload) } + func (o *WellKnownOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -77,7 +79,7 @@ func NewWellKnownInternalServerError() *WellKnownInternalServerError { return &WellKnownInternalServerError{} } -/* WellKnownInternalServerError describes a response with status code 500, with default header values. +/*WellKnownInternalServerError handles this case with default header values. jsonError */ @@ -88,6 +90,7 @@ type WellKnownInternalServerError struct { func (o *WellKnownInternalServerError) Error() string { return fmt.Sprintf("[GET /.well-known/jwks.json][%d] wellKnownInternalServerError %+v", 500, o.Payload) } + func (o *WellKnownInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/models/accept_consent_request.go b/internal/httpclient/models/accept_consent_request.go index 2d2123225fa..89d31c9c64a 100644 --- a/internal/httpclient/models/accept_consent_request.go +++ b/internal/httpclient/models/accept_consent_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -67,6 +65,7 @@ func (m *AcceptConsentRequest) Validate(formats strfmt.Registry) error { } func (m *AcceptConsentRequest) validateGrantAccessTokenAudience(formats strfmt.Registry) error { + if swag.IsZero(m.GrantAccessTokenAudience) { // not required return nil } @@ -82,6 +81,7 @@ func (m *AcceptConsentRequest) validateGrantAccessTokenAudience(formats strfmt.R } func (m *AcceptConsentRequest) validateGrantScope(formats strfmt.Registry) error { + if swag.IsZero(m.GrantScope) { // not required return nil } @@ -97,6 +97,7 @@ func (m *AcceptConsentRequest) validateGrantScope(formats strfmt.Registry) error } func (m *AcceptConsentRequest) validateHandledAt(formats strfmt.Registry) error { + if swag.IsZero(m.HandledAt) { // not required return nil } @@ -112,6 +113,7 @@ func (m *AcceptConsentRequest) validateHandledAt(formats strfmt.Registry) error } func (m *AcceptConsentRequest) validateSession(formats strfmt.Registry) error { + if swag.IsZero(m.Session) { // not required return nil } @@ -128,82 +130,6 @@ func (m *AcceptConsentRequest) validateSession(formats strfmt.Registry) error { return nil } -// ContextValidate validate this accept consent request based on the context it is used -func (m *AcceptConsentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGrantAccessTokenAudience(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrantScope(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHandledAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSession(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AcceptConsentRequest) contextValidateGrantAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GrantAccessTokenAudience.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_access_token_audience") - } - return err - } - - return nil -} - -func (m *AcceptConsentRequest) contextValidateGrantScope(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GrantScope.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_scope") - } - return err - } - - return nil -} - -func (m *AcceptConsentRequest) contextValidateHandledAt(ctx context.Context, formats strfmt.Registry) error { - - if err := m.HandledAt.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("handled_at") - } - return err - } - - return nil -} - -func (m *AcceptConsentRequest) contextValidateSession(ctx context.Context, formats strfmt.Registry) error { - - if m.Session != nil { - if err := m.Session.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("session") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *AcceptConsentRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/accept_login_request.go b/internal/httpclient/models/accept_login_request.go index fd664811b2c..023af51363d 100644 --- a/internal/httpclient/models/accept_login_request.go +++ b/internal/httpclient/models/accept_login_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -105,11 +103,6 @@ func (m *AcceptLoginRequest) validateSubject(formats strfmt.Registry) error { return nil } -// ContextValidate validates this accept login request based on context it is used -func (m *AcceptLoginRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *AcceptLoginRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/completed_request.go b/internal/httpclient/models/completed_request.go index 2878fd455ba..ea54e898220 100644 --- a/internal/httpclient/models/completed_request.go +++ b/internal/httpclient/models/completed_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -47,11 +45,6 @@ func (m *CompletedRequest) validateRedirectTo(formats strfmt.Registry) error { return nil } -// ContextValidate validates this completed request based on context it is used -func (m *CompletedRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *CompletedRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/consent_request.go b/internal/httpclient/models/consent_request.go index be764b07196..ca62a4a1456 100644 --- a/internal/httpclient/models/consent_request.go +++ b/internal/httpclient/models/consent_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -131,6 +129,7 @@ func (m *ConsentRequest) validateChallenge(formats strfmt.Registry) error { } func (m *ConsentRequest) validateClient(formats strfmt.Registry) error { + if swag.IsZero(m.Client) { // not required return nil } @@ -148,6 +147,7 @@ func (m *ConsentRequest) validateClient(formats strfmt.Registry) error { } func (m *ConsentRequest) validateOidcContext(formats strfmt.Registry) error { + if swag.IsZero(m.OidcContext) { // not required return nil } @@ -165,6 +165,7 @@ func (m *ConsentRequest) validateOidcContext(formats strfmt.Registry) error { } func (m *ConsentRequest) validateRequestedAccessTokenAudience(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedAccessTokenAudience) { // not required return nil } @@ -180,6 +181,7 @@ func (m *ConsentRequest) validateRequestedAccessTokenAudience(formats strfmt.Reg } func (m *ConsentRequest) validateRequestedScope(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedScope) { // not required return nil } @@ -194,84 +196,6 @@ func (m *ConsentRequest) validateRequestedScope(formats strfmt.Registry) error { return nil } -// ContextValidate validate this consent request based on the context it is used -func (m *ConsentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClient(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOidcContext(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedAccessTokenAudience(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedScope(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConsentRequest) contextValidateClient(ctx context.Context, formats strfmt.Registry) error { - - if m.Client != nil { - if err := m.Client.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("client") - } - return err - } - } - - return nil -} - -func (m *ConsentRequest) contextValidateOidcContext(ctx context.Context, formats strfmt.Registry) error { - - if m.OidcContext != nil { - if err := m.OidcContext.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("oidc_context") - } - return err - } - } - - return nil -} - -func (m *ConsentRequest) contextValidateRequestedAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RequestedAccessTokenAudience.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requested_access_token_audience") - } - return err - } - - return nil -} - -func (m *ConsentRequest) contextValidateRequestedScope(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RequestedScope.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requested_scope") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *ConsentRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/consent_request_session.go b/internal/httpclient/models/consent_request_session.go index eaab7a24543..0cd2ae45dac 100644 --- a/internal/httpclient/models/consent_request_session.go +++ b/internal/httpclient/models/consent_request_session.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -33,11 +31,6 @@ func (m *ConsentRequestSession) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this consent request session based on context it is used -func (m *ConsentRequestSession) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *ConsentRequestSession) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/container_wait_o_k_body_error.go b/internal/httpclient/models/container_wait_o_k_body_error.go index 70637b4ce65..cc8113bb2a5 100644 --- a/internal/httpclient/models/container_wait_o_k_body_error.go +++ b/internal/httpclient/models/container_wait_o_k_body_error.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,11 +24,6 @@ func (m *ContainerWaitOKBodyError) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this container wait o k body error based on context it is used -func (m *ContainerWaitOKBodyError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *ContainerWaitOKBodyError) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/flush_inactive_jwt_bearer_grants_params.go b/internal/httpclient/models/flush_inactive_jwt_bearer_grants_params.go deleted file mode 100644 index 9c5e6908766..00000000000 --- a/internal/httpclient/models/flush_inactive_jwt_bearer_grants_params.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// FlushInactiveJwtBearerGrantsParams flush inactive jwt bearer grants params -// -// swagger:model flushInactiveJwtBearerGrantsParams -type FlushInactiveJwtBearerGrantsParams struct { - - // The "notAfter" sets after which point grants should not be flushed. This is useful when you want to keep a history - // of recently added grants. - // Format: date-time - NotAfter strfmt.DateTime `json:"notAfter,omitempty"` -} - -// Validate validates this flush inactive jwt bearer grants params -func (m *FlushInactiveJwtBearerGrantsParams) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateNotAfter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FlushInactiveJwtBearerGrantsParams) validateNotAfter(formats strfmt.Registry) error { - - if swag.IsZero(m.NotAfter) { // not required - return nil - } - - if err := validate.FormatOf("notAfter", "body", "date-time", m.NotAfter.String(), formats); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *FlushInactiveJwtBearerGrantsParams) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FlushInactiveJwtBearerGrantsParams) UnmarshalBinary(b []byte) error { - var res FlushInactiveJwtBearerGrantsParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go b/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go index 42c82eff485..6bd161403a9 100644 --- a/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go +++ b/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -40,6 +38,7 @@ func (m *FlushInactiveOAuth2TokensRequest) Validate(formats strfmt.Registry) err } func (m *FlushInactiveOAuth2TokensRequest) validateNotAfter(formats strfmt.Registry) error { + if swag.IsZero(m.NotAfter) { // not required return nil } @@ -51,11 +50,6 @@ func (m *FlushInactiveOAuth2TokensRequest) validateNotAfter(formats strfmt.Regis return nil } -// ContextValidate validates this flush inactive o auth2 tokens request based on context it is used -func (m *FlushInactiveOAuth2TokensRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *FlushInactiveOAuth2TokensRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/generic_error.go b/internal/httpclient/models/generic_error.go index 7f1f9cff3a1..4b988320c75 100644 --- a/internal/httpclient/models/generic_error.go +++ b/internal/httpclient/models/generic_error.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -20,43 +18,38 @@ import ( type GenericError struct { // The status code - // - // Example: 404 Code int64 `json:"code,omitempty"` // Debug information // // This field is often not exposed to protect against leaking // sensitive information. - // - // Example: SQL field \"foo\" is not a bool. Debug string `json:"debug,omitempty"` // Further error details Details interface{} `json:"details,omitempty"` + // The error ID + // + // Useful when trying to identify various errors in application logic. + ID string `json:"id,omitempty"` + // Error message // // The error's message. - // - // Example: The resource could not be found // Required: true Message *string `json:"message"` // A human-readable reason for the error - // - // Example: User with ID 1234 does not exist. Reason string `json:"reason,omitempty"` // The request ID // // The request ID is often exposed internally in order to trace // errors across service architectures. This is often a UUID. - // Example: d7ef54b1-ec15-46e6-bccb-524b82c035e6 Request string `json:"request,omitempty"` // The status description - // Example: Not Found Status string `json:"status,omitempty"` } @@ -83,11 +76,6 @@ func (m *GenericError) validateMessage(formats strfmt.Registry) error { return nil } -// ContextValidate validates this generic error based on context it is used -func (m *GenericError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *GenericError) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/health_not_ready_status.go b/internal/httpclient/models/health_not_ready_status.go index bab6d3873e8..64626783ed4 100644 --- a/internal/httpclient/models/health_not_ready_status.go +++ b/internal/httpclient/models/health_not_ready_status.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,11 +24,6 @@ func (m *HealthNotReadyStatus) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this health not ready status based on context it is used -func (m *HealthNotReadyStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *HealthNotReadyStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/health_status.go b/internal/httpclient/models/health_status.go index 5525dbc20ea..60ba32416b0 100644 --- a/internal/httpclient/models/health_status.go +++ b/internal/httpclient/models/health_status.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,11 +24,6 @@ func (m *HealthStatus) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this health status based on context it is used -func (m *HealthStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *HealthStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_error.go b/internal/httpclient/models/json_error.go index 5bd88f6e897..9819ea3551e 100644 --- a/internal/httpclient/models/json_error.go +++ b/internal/httpclient/models/json_error.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -20,19 +18,15 @@ import ( type JSONError struct { // Name is the error name. - // Example: The requested resource could not be found Error string `json:"error,omitempty"` // Debug contains debug information. This is usually not available and has to be enabled. - // Example: The database adapter was unable to find the element ErrorDebug string `json:"error_debug,omitempty"` // Description contains further information on the nature of the error. - // Example: Object with ID 12345 does not exist ErrorDescription string `json:"error_description,omitempty"` // Code represents the error status code (404, 403, 401, ...). - // Example: 404 StatusCode int64 `json:"status_code,omitempty"` } @@ -41,11 +35,6 @@ func (m *JSONError) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this json error based on context it is used -func (m *JSONError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *JSONError) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_web_key.go b/internal/httpclient/models/json_web_key.go index 53f9bca2f92..737cde8d02d 100644 --- a/internal/httpclient/models/json_web_key.go +++ b/internal/httpclient/models/json_web_key.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -26,32 +24,25 @@ type JSONWebKey struct { // IANA "JSON Web Signature and Encryption Algorithms" registry // established by [JWA] or be a value that contains a Collision- // Resistant Name. - // Example: RS256 // Required: true Alg *string `json:"alg"` // crv - // Example: P-256 Crv string `json:"crv,omitempty"` // d - // Example: T_N8I-6He3M8a7X1vWt6TGIx4xB_GP3Mb4SsZSA4v-orvJzzRiQhLlRR81naWYxfQAYt5isDI6_C2L9bdWo4FFPjGQFvNoRX-_sBJyBI_rl-TBgsZYoUlAj3J92WmY2inbA-PwyJfsaIIDceYBC-eX-xiCu6qMqkZi3MwQAFL6bMdPEM0z4JBcwFT3VdiWAIRUuACWQwrXMq672x7fMuaIaHi7XDGgt1ith23CLfaREmJku9PQcchbt_uEY-hqrFY6ntTtS4paWWQj86xLL94S-Tf6v6xkL918PfLSOTq6XCzxvlFwzBJqApnAhbwqLjpPhgUG04EDRrqrSBc5Y1BLevn6Ip5h1AhessBp3wLkQgz_roeckt-ybvzKTjESMuagnpqLvOT7Y9veIug2MwPJZI2VjczRc1vzMs25XrFQ8DpUy-bNdp89TmvAXwctUMiJdgHloJw23Cv03gIUAkDnsTqZmkpbIf-crpgNKFmQP_EDKoe8p_PXZZgfbRri3NoEVGP7Mk6yEu8LjJhClhZaBNjuWw2-KlBfOA3g79mhfBnkInee5KO9mGR50qPk1V-MorUYNTFMZIm0kFE6eYVWFBwJHLKYhHU34DoiK1VP-svZpC2uAMFNA_UJEwM9CQ2b8qe4-5e9aywMvwcuArRkAB5mBIfOaOJao3mfukKAE D string `json:"d,omitempty"` // dp - // Example: G4sPXkc6Ya9y8oJW9_ILj4xuppu0lzi_H7VTkS8xj5SdX3coE0oimYwxIi2emTAue0UOa5dpgFGyBJ4c8tQ2VF402XRugKDTP8akYhFo5tAA77Qe_NmtuYZc3C3m3I24G2GvR5sSDxUyAN2zq8Lfn9EUms6rY3Ob8YeiKkTiBj0 Dp string `json:"dp,omitempty"` // dq - // Example: s9lAH9fggBsoFR8Oac2R_E2gw282rT2kGOAhvIllETE1efrA6huUUvMfBcMpn8lqeW6vzznYY5SSQF7pMdC_agI3nG8Ibp1BUb0JUiraRNqUfLhcQb_d9GF4Dh7e74WbRsobRonujTYN1xCaP6TO61jvWrX-L18txXw494Q_cgk Dq string `json:"dq,omitempty"` // e - // Example: AQAB E string `json:"e,omitempty"` // k - // Example: GawgguFyGrWKav7AX4VKUg K string `json:"k,omitempty"` // The "kid" (key ID) parameter is used to match a specific key. This @@ -63,7 +54,6 @@ type JSONWebKey struct { // they have different "kty" (key type) values but are considered to be // equivalent alternatives by the application using them.) The "kid" // value is a case-sensitive string. - // Example: 1603dfe0af8f4596 // Required: true Kid *string `json:"kid"` @@ -72,36 +62,29 @@ type JSONWebKey struct { // either be registered in the IANA "JSON Web Key Types" registry // established by [JWA] or be a value that contains a Collision- // Resistant Name. The "kty" value is a case-sensitive string. - // Example: RSA // Required: true Kty *string `json:"kty"` // n - // Example: vTqrxUyQPl_20aqf5kXHwDZrel-KovIp8s7ewJod2EXHl8tWlRB3_Rem34KwBfqlKQGp1nqah-51H4Jzruqe0cFP58hPEIt6WqrvnmJCXxnNuIB53iX_uUUXXHDHBeaPCSRoNJzNysjoJ30TIUsKBiirhBa7f235PXbKiHducLevV6PcKxJ5cY8zO286qJLBWSPm-OIevwqsIsSIH44Qtm9sioFikhkbLwoqwWORGAY0nl6XvVOlhADdLjBSqSAeT1FPuCDCnXwzCDR8N9IFB_IjdStFkC-rVt2K5BYfPd0c3yFp_vHR15eRd0zJ8XQ7woBC8Vnsac6Et1pKS59pX6256DPWu8UDdEOolKAPgcd_g2NpA76cAaF_jcT80j9KrEzw8Tv0nJBGesuCjPNjGs_KzdkWTUXt23Hn9QJsdc1MZuaW0iqXBepHYfYoqNelzVte117t4BwVp0kUM6we0IqyXClaZgOI8S-WDBw2_Ovdm8e5NmhYAblEVoygcX8Y46oH6bKiaCQfKCFDMcRgChme7AoE1yZZYsPbaG_3IjPrC4LBMHQw8rM9dWjJ8ImjicvZ1pAm0dx-KHCP3y5PVKrxBDf1zSOsBRkOSjB8TPODnJMz6-jd5hTtZxpZPwPoIdCanTZ3ZD6uRBpTmDwtpRGm63UQs1m5FWPwb0T2IF0 N string `json:"n,omitempty"` // p - // Example: 6NbkXwDWUhi-eR55Cgbf27FkQDDWIamOaDr0rj1q0f1fFEz1W5A_09YvG09Fiv1AO2-D8Rl8gS1Vkz2i0zCSqnyy8A025XOcRviOMK7nIxE4OH_PEsko8dtIrb3TmE2hUXvCkmzw9EsTF1LQBOGC6iusLTXepIC1x9ukCKFZQvdgtEObQ5kzd9Nhq-cdqmSeMVLoxPLd1blviVT9Vm8-y12CtYpeJHOaIDtVPLlBhJiBoPKWg3vxSm4XxIliNOefqegIlsmTIa3MpS6WWlCK3yHhat0Q-rRxDxdyiVdG_wzJvp0Iw_2wms7pe-PgNPYvUWH9JphWP5K38YqEBiJFXQ P string `json:"p,omitempty"` // q - // Example: 0A1FmpOWR91_RAWpqreWSavNaZb9nXeKiBo0DQGBz32DbqKqQ8S4aBJmbRhJcctjCLjain-ivut477tAUMmzJwVJDDq2MZFwC9Q-4VYZmFU4HJityQuSzHYe64RjN-E_NQ02TWhG3QGW6roq6c57c99rrUsETwJJiwS8M5p15Miuz53DaOjv-uqqFAFfywN5WkxHbraBcjHtMiQuyQbQqkCFh-oanHkwYNeytsNhTu2mQmwR5DR2roZ2nPiFjC6nsdk-A7E3S3wMzYYFw7jvbWWoYWo9vB40_MY2Y0FYQSqcDzcBIcq_0tnnasf3VW4Fdx6m80RzOb2Fsnln7vKXAQ Q string `json:"q,omitempty"` // qi - // Example: GyM_p6JrXySiz1toFgKbWV-JdI3jQ4ypu9rbMWx3rQJBfmt0FoYzgUIZEVFEcOqwemRN81zoDAaa-Bk0KWNGDjJHZDdDmFhW3AN7lI-puxk_mHZGJ11rxyR8O55XLSe3SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU Qi string `json:"qi,omitempty"` // Use ("public key use") identifies the intended use of // the public key. The "use" parameter is employed to indicate whether // a public key is used for encrypting data or verifying the signature // on data. Values are commonly "sig" (signature) or "enc" (encryption). - // Example: sig // Required: true Use *string `json:"use"` // x - // Example: f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU X string `json:"x,omitempty"` // The "x5c" (X.509 certificate chain) parameter contains a chain of one @@ -114,7 +97,6 @@ type JSONWebKey struct { X5c []string `json:"x5c"` // y - // Example: x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0 Y string `json:"y,omitempty"` } @@ -180,11 +162,6 @@ func (m *JSONWebKey) validateUse(formats strfmt.Registry) error { return nil } -// ContextValidate validates this JSON web key based on context it is used -func (m *JSONWebKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *JSONWebKey) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_web_key_set.go b/internal/httpclient/models/json_web_key_set.go index cd57ff03687..87649fa82c9 100644 --- a/internal/httpclient/models/json_web_key_set.go +++ b/internal/httpclient/models/json_web_key_set.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -46,6 +45,7 @@ func (m *JSONWebKeySet) Validate(formats strfmt.Registry) error { } func (m *JSONWebKeySet) validateKeys(formats strfmt.Registry) error { + if swag.IsZero(m.Keys) { // not required return nil } @@ -69,38 +69,6 @@ func (m *JSONWebKeySet) validateKeys(formats strfmt.Registry) error { return nil } -// ContextValidate validate this JSON web key set based on the context it is used -func (m *JSONWebKeySet) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateKeys(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JSONWebKeySet) contextValidateKeys(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Keys); i++ { - - if m.Keys[i] != nil { - if err := m.Keys[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keys" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - // MarshalBinary interface implementation func (m *JSONWebKeySet) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_web_key_set_generator_request.go b/internal/httpclient/models/json_web_key_set_generator_request.go index 1c7240763e2..93f447138c0 100644 --- a/internal/httpclient/models/json_web_key_set_generator_request.go +++ b/internal/httpclient/models/json_web_key_set_generator_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -84,11 +82,6 @@ func (m *JSONWebKeySetGeneratorRequest) validateUse(formats strfmt.Registry) err return nil } -// ContextValidate validates this json web key set generator request based on context it is used -func (m *JSONWebKeySetGeneratorRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *JSONWebKeySetGeneratorRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/login_request.go b/internal/httpclient/models/login_request.go index 7148d4cfddc..4cf1b2d991b 100644 --- a/internal/httpclient/models/login_request.go +++ b/internal/httpclient/models/login_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -135,6 +133,7 @@ func (m *LoginRequest) validateClient(formats strfmt.Registry) error { } func (m *LoginRequest) validateOidcContext(formats strfmt.Registry) error { + if swag.IsZero(m.OidcContext) { // not required return nil } @@ -210,84 +209,6 @@ func (m *LoginRequest) validateSubject(formats strfmt.Registry) error { return nil } -// ContextValidate validate this login request based on the context it is used -func (m *LoginRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClient(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOidcContext(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedAccessTokenAudience(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedScope(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LoginRequest) contextValidateClient(ctx context.Context, formats strfmt.Registry) error { - - if m.Client != nil { - if err := m.Client.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("client") - } - return err - } - } - - return nil -} - -func (m *LoginRequest) contextValidateOidcContext(ctx context.Context, formats strfmt.Registry) error { - - if m.OidcContext != nil { - if err := m.OidcContext.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("oidc_context") - } - return err - } - } - - return nil -} - -func (m *LoginRequest) contextValidateRequestedAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RequestedAccessTokenAudience.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requested_access_token_audience") - } - return err - } - - return nil -} - -func (m *LoginRequest) contextValidateRequestedScope(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RequestedScope.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requested_scope") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *LoginRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/logout_request.go b/internal/httpclient/models/logout_request.go index 7450df11727..df025037502 100644 --- a/internal/httpclient/models/logout_request.go +++ b/internal/httpclient/models/logout_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -53,6 +51,7 @@ func (m *LogoutRequest) Validate(formats strfmt.Registry) error { } func (m *LogoutRequest) validateClient(formats strfmt.Registry) error { + if swag.IsZero(m.Client) { // not required return nil } @@ -69,34 +68,6 @@ func (m *LogoutRequest) validateClient(formats strfmt.Registry) error { return nil } -// ContextValidate validate this logout request based on the context it is used -func (m *LogoutRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClient(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LogoutRequest) contextValidateClient(ctx context.Context, formats strfmt.Registry) error { - - if m.Client != nil { - if err := m.Client.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("client") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *LogoutRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/null_time.go b/internal/httpclient/models/null_time.go index 46130d04b0b..8e2e60607ff 100644 --- a/internal/httpclient/models/null_time.go +++ b/internal/httpclient/models/null_time.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -43,11 +41,6 @@ func (m NullTime) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this null time based on context it is used -func (m NullTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *NullTime) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/o_auth2_client.go b/internal/httpclient/models/o_auth2_client.go index f625d8421ec..0324fb28bef 100644 --- a/internal/httpclient/models/o_auth2_client.go +++ b/internal/httpclient/models/o_auth2_client.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -215,6 +213,7 @@ func (m *OAuth2Client) Validate(formats strfmt.Registry) error { } func (m *OAuth2Client) validateAllowedCorsOrigins(formats strfmt.Registry) error { + if swag.IsZero(m.AllowedCorsOrigins) { // not required return nil } @@ -230,6 +229,7 @@ func (m *OAuth2Client) validateAllowedCorsOrigins(formats strfmt.Registry) error } func (m *OAuth2Client) validateAudience(formats strfmt.Registry) error { + if swag.IsZero(m.Audience) { // not required return nil } @@ -245,6 +245,7 @@ func (m *OAuth2Client) validateAudience(formats strfmt.Registry) error { } func (m *OAuth2Client) validateContacts(formats strfmt.Registry) error { + if swag.IsZero(m.Contacts) { // not required return nil } @@ -260,6 +261,7 @@ func (m *OAuth2Client) validateContacts(formats strfmt.Registry) error { } func (m *OAuth2Client) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -272,6 +274,7 @@ func (m *OAuth2Client) validateCreatedAt(formats strfmt.Registry) error { } func (m *OAuth2Client) validateGrantTypes(formats strfmt.Registry) error { + if swag.IsZero(m.GrantTypes) { // not required return nil } @@ -287,6 +290,7 @@ func (m *OAuth2Client) validateGrantTypes(formats strfmt.Registry) error { } func (m *OAuth2Client) validatePostLogoutRedirectUris(formats strfmt.Registry) error { + if swag.IsZero(m.PostLogoutRedirectUris) { // not required return nil } @@ -302,6 +306,7 @@ func (m *OAuth2Client) validatePostLogoutRedirectUris(formats strfmt.Registry) e } func (m *OAuth2Client) validateRedirectUris(formats strfmt.Registry) error { + if swag.IsZero(m.RedirectUris) { // not required return nil } @@ -317,6 +322,7 @@ func (m *OAuth2Client) validateRedirectUris(formats strfmt.Registry) error { } func (m *OAuth2Client) validateRequestUris(formats strfmt.Registry) error { + if swag.IsZero(m.RequestUris) { // not required return nil } @@ -332,6 +338,7 @@ func (m *OAuth2Client) validateRequestUris(formats strfmt.Registry) error { } func (m *OAuth2Client) validateResponseTypes(formats strfmt.Registry) error { + if swag.IsZero(m.ResponseTypes) { // not required return nil } @@ -347,11 +354,12 @@ func (m *OAuth2Client) validateResponseTypes(formats strfmt.Registry) error { } func (m *OAuth2Client) validateScope(formats strfmt.Registry) error { + if swag.IsZero(m.Scope) { // not required return nil } - if err := validate.Pattern("scope", "body", m.Scope, `([a-zA-Z0-9\.\*]+\s?)+`); err != nil { + if err := validate.Pattern("scope", "body", string(m.Scope), `([a-zA-Z0-9\.\*]+\s?)+`); err != nil { return err } @@ -359,6 +367,7 @@ func (m *OAuth2Client) validateScope(formats strfmt.Registry) error { } func (m *OAuth2Client) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -370,144 +379,6 @@ func (m *OAuth2Client) validateUpdatedAt(formats strfmt.Registry) error { return nil } -// ContextValidate validate this o auth2 client based on the context it is used -func (m *OAuth2Client) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAllowedCorsOrigins(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAudience(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateContacts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrantTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostLogoutRedirectUris(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRedirectUris(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestUris(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateResponseTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OAuth2Client) contextValidateAllowedCorsOrigins(ctx context.Context, formats strfmt.Registry) error { - - if err := m.AllowedCorsOrigins.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("allowed_cors_origins") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateAudience(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Audience.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("audience") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateContacts(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Contacts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("contacts") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateGrantTypes(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GrantTypes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_types") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidatePostLogoutRedirectUris(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PostLogoutRedirectUris.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("post_logout_redirect_uris") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateRedirectUris(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RedirectUris.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("redirect_uris") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateRequestUris(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RequestUris.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("request_uris") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateResponseTypes(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ResponseTypes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("response_types") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *OAuth2Client) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/o_auth2_token_introspection.go b/internal/httpclient/models/o_auth2_token_introspection.go index a881a0d3ed2..fb97d72d935 100644 --- a/internal/httpclient/models/o_auth2_token_introspection.go +++ b/internal/httpclient/models/o_auth2_token_introspection.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -107,11 +105,6 @@ func (m *OAuth2TokenIntrospection) validateActive(formats strfmt.Registry) error return nil } -// ContextValidate validates this o auth2 token introspection based on context it is used -func (m *OAuth2TokenIntrospection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *OAuth2TokenIntrospection) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/oauth2_token_response.go b/internal/httpclient/models/oauth2_token_response.go index 542885008fe..4aec720a00f 100644 --- a/internal/httpclient/models/oauth2_token_response.go +++ b/internal/httpclient/models/oauth2_token_response.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -41,11 +39,6 @@ func (m *Oauth2TokenResponse) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this oauth2 token response based on context it is used -func (m *Oauth2TokenResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *Oauth2TokenResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/open_id_connect_context.go b/internal/httpclient/models/open_id_connect_context.go index 398840441e0..cbfdd337e40 100644 --- a/internal/httpclient/models/open_id_connect_context.go +++ b/internal/httpclient/models/open_id_connect_context.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -61,11 +59,6 @@ func (m *OpenIDConnectContext) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this open ID connect context based on context it is used -func (m *OpenIDConnectContext) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *OpenIDConnectContext) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/patch_document.go b/internal/httpclient/models/patch_document.go index 0f8b9cac0db..fb3ea3652ef 100644 --- a/internal/httpclient/models/patch_document.go +++ b/internal/httpclient/models/patch_document.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -23,12 +21,10 @@ type PatchDocument struct { From string `json:"from,omitempty"` // The operation to be performed - // Example: \"replace\ // Required: true Op *string `json:"op"` // A JSON-pointer - // Example: \"/name\ // Required: true Path *string `json:"path"` @@ -72,11 +68,6 @@ func (m *PatchDocument) validatePath(formats strfmt.Registry) error { return nil } -// ContextValidate validates this patch document based on context it is used -func (m *PatchDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PatchDocument) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/patch_request.go b/internal/httpclient/models/patch_request.go index e974c6748e9..df227f4b73e 100644 --- a/internal/httpclient/models/patch_request.go +++ b/internal/httpclient/models/patch_request.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -44,26 +43,3 @@ func (m PatchRequest) Validate(formats strfmt.Registry) error { } return nil } - -// ContextValidate validate this patch request based on the context it is used -func (m PatchRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/models/plugin_config.go b/internal/httpclient/models/plugin_config.go index d062713f842..caaeea8e7d6 100644 --- a/internal/httpclient/models/plugin_config.go +++ b/internal/httpclient/models/plugin_config.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -329,6 +328,7 @@ func (m *PluginConfig) validatePropagatedMount(formats strfmt.Registry) error { } func (m *PluginConfig) validateUser(formats strfmt.Registry) error { + if swag.IsZero(m.User) { // not required return nil } @@ -355,6 +355,7 @@ func (m *PluginConfig) validateWorkDir(formats strfmt.Registry) error { } func (m *PluginConfig) validateRootfs(formats strfmt.Registry) error { + if swag.IsZero(m.Rootfs) { // not required return nil } @@ -371,168 +372,6 @@ func (m *PluginConfig) validateRootfs(formats strfmt.Registry) error { return nil } -// ContextValidate validate this plugin config based on the context it is used -func (m *PluginConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateArgs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEnv(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateInterface(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLinux(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMounts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetwork(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUser(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRootfs(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PluginConfig) contextValidateArgs(ctx context.Context, formats strfmt.Registry) error { - - if m.Args != nil { - if err := m.Args.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Args") - } - return err - } - } - - return nil -} - -func (m *PluginConfig) contextValidateEnv(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Env); i++ { - - if m.Env[i] != nil { - if err := m.Env[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Env" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PluginConfig) contextValidateInterface(ctx context.Context, formats strfmt.Registry) error { - - if m.Interface != nil { - if err := m.Interface.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Interface") - } - return err - } - } - - return nil -} - -func (m *PluginConfig) contextValidateLinux(ctx context.Context, formats strfmt.Registry) error { - - if m.Linux != nil { - if err := m.Linux.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Linux") - } - return err - } - } - - return nil -} - -func (m *PluginConfig) contextValidateMounts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Mounts); i++ { - - if m.Mounts[i] != nil { - if err := m.Mounts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Mounts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PluginConfig) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error { - - if m.Network != nil { - if err := m.Network.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Network") - } - return err - } - } - - return nil -} - -func (m *PluginConfig) contextValidateUser(ctx context.Context, formats strfmt.Registry) error { - - if m.User != nil { - if err := m.User.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("User") - } - return err - } - } - - return nil -} - -func (m *PluginConfig) contextValidateRootfs(ctx context.Context, formats strfmt.Registry) error { - - if m.Rootfs != nil { - if err := m.Rootfs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rootfs") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *PluginConfig) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_args.go b/internal/httpclient/models/plugin_config_args.go index 15a65d6994a..053450e0ae9 100644 --- a/internal/httpclient/models/plugin_config_args.go +++ b/internal/httpclient/models/plugin_config_args.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -98,11 +96,6 @@ func (m *PluginConfigArgs) validateValue(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin config args based on context it is used -func (m *PluginConfigArgs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginConfigArgs) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_interface.go b/internal/httpclient/models/plugin_config_interface.go index 3e77cc86694..43b13c30c2e 100644 --- a/internal/httpclient/models/plugin_config_interface.go +++ b/internal/httpclient/models/plugin_config_interface.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -84,38 +83,6 @@ func (m *PluginConfigInterface) validateTypes(formats strfmt.Registry) error { return nil } -// ContextValidate validate this plugin config interface based on the context it is used -func (m *PluginConfigInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PluginConfigInterface) contextValidateTypes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Types); i++ { - - if m.Types[i] != nil { - if err := m.Types[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Types" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - // MarshalBinary interface implementation func (m *PluginConfigInterface) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_linux_swagger.go b/internal/httpclient/models/plugin_config_linux_swagger.go index 046ba2ab691..5671eb4d28a 100644 --- a/internal/httpclient/models/plugin_config_linux_swagger.go +++ b/internal/httpclient/models/plugin_config_linux_swagger.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -98,38 +97,6 @@ func (m *PluginConfigLinux) validateDevices(formats strfmt.Registry) error { return nil } -// ContextValidate validate this plugin config linux based on the context it is used -func (m *PluginConfigLinux) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDevices(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PluginConfigLinux) contextValidateDevices(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Devices); i++ { - - if m.Devices[i] != nil { - if err := m.Devices[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Devices" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - // MarshalBinary interface implementation func (m *PluginConfigLinux) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_network.go b/internal/httpclient/models/plugin_config_network.go index 89fb2c56807..5649fd30a9b 100644 --- a/internal/httpclient/models/plugin_config_network.go +++ b/internal/httpclient/models/plugin_config_network.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -47,11 +45,6 @@ func (m *PluginConfigNetwork) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin config network based on context it is used -func (m *PluginConfigNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginConfigNetwork) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_rootfs.go b/internal/httpclient/models/plugin_config_rootfs.go index 64d545ac12b..4497e49a3fe 100644 --- a/internal/httpclient/models/plugin_config_rootfs.go +++ b/internal/httpclient/models/plugin_config_rootfs.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -29,11 +27,6 @@ func (m *PluginConfigRootfs) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin config rootfs based on context it is used -func (m *PluginConfigRootfs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginConfigRootfs) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_user.go b/internal/httpclient/models/plugin_config_user.go index 610727721e9..73574d68ff6 100644 --- a/internal/httpclient/models/plugin_config_user.go +++ b/internal/httpclient/models/plugin_config_user.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -29,11 +27,6 @@ func (m *PluginConfigUser) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin config user based on context it is used -func (m *PluginConfigUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginConfigUser) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_device.go b/internal/httpclient/models/plugin_device.go index 8818e2dd71a..7a3de422abc 100644 --- a/internal/httpclient/models/plugin_device.go +++ b/internal/httpclient/models/plugin_device.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -98,11 +96,6 @@ func (m *PluginDevice) validateSettable(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin device based on context it is used -func (m *PluginDevice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginDevice) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_env.go b/internal/httpclient/models/plugin_env.go index 00c2bcc6d69..6ed6644db68 100644 --- a/internal/httpclient/models/plugin_env.go +++ b/internal/httpclient/models/plugin_env.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -98,11 +96,6 @@ func (m *PluginEnv) validateValue(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin env based on context it is used -func (m *PluginEnv) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginEnv) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_interface_type.go b/internal/httpclient/models/plugin_interface_type.go index cb3185daba1..d66549040eb 100644 --- a/internal/httpclient/models/plugin_interface_type.go +++ b/internal/httpclient/models/plugin_interface_type.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -81,11 +79,6 @@ func (m *PluginInterfaceType) validateVersion(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin interface type based on context it is used -func (m *PluginInterfaceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginInterfaceType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_mount.go b/internal/httpclient/models/plugin_mount.go index be79d1e16bd..41eadd58191 100644 --- a/internal/httpclient/models/plugin_mount.go +++ b/internal/httpclient/models/plugin_mount.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -149,11 +147,6 @@ func (m *PluginMount) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin mount based on context it is used -func (m *PluginMount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginMount) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_settings.go b/internal/httpclient/models/plugin_settings.go index 5da66acb905..4e7d4ba9748 100644 --- a/internal/httpclient/models/plugin_settings.go +++ b/internal/httpclient/models/plugin_settings.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -131,60 +130,6 @@ func (m *PluginSettings) validateMounts(formats strfmt.Registry) error { return nil } -// ContextValidate validate this plugin settings based on the context it is used -func (m *PluginSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDevices(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMounts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PluginSettings) contextValidateDevices(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Devices); i++ { - - if m.Devices[i] != nil { - if err := m.Devices[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Devices" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PluginSettings) contextValidateMounts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Mounts); i++ { - - if m.Mounts[i] != nil { - if err := m.Mounts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Mounts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - // MarshalBinary interface implementation func (m *PluginSettings) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/previous_consent_session.go b/internal/httpclient/models/previous_consent_session.go index 28e68bad493..b0b0616f356 100644 --- a/internal/httpclient/models/previous_consent_session.go +++ b/internal/httpclient/models/previous_consent_session.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -75,6 +73,7 @@ func (m *PreviousConsentSession) Validate(formats strfmt.Registry) error { } func (m *PreviousConsentSession) validateConsentRequest(formats strfmt.Registry) error { + if swag.IsZero(m.ConsentRequest) { // not required return nil } @@ -92,6 +91,7 @@ func (m *PreviousConsentSession) validateConsentRequest(formats strfmt.Registry) } func (m *PreviousConsentSession) validateGrantAccessTokenAudience(formats strfmt.Registry) error { + if swag.IsZero(m.GrantAccessTokenAudience) { // not required return nil } @@ -107,6 +107,7 @@ func (m *PreviousConsentSession) validateGrantAccessTokenAudience(formats strfmt } func (m *PreviousConsentSession) validateGrantScope(formats strfmt.Registry) error { + if swag.IsZero(m.GrantScope) { // not required return nil } @@ -122,6 +123,7 @@ func (m *PreviousConsentSession) validateGrantScope(formats strfmt.Registry) err } func (m *PreviousConsentSession) validateHandledAt(formats strfmt.Registry) error { + if swag.IsZero(m.HandledAt) { // not required return nil } @@ -137,6 +139,7 @@ func (m *PreviousConsentSession) validateHandledAt(formats strfmt.Registry) erro } func (m *PreviousConsentSession) validateSession(formats strfmt.Registry) error { + if swag.IsZero(m.Session) { // not required return nil } @@ -153,100 +156,6 @@ func (m *PreviousConsentSession) validateSession(formats strfmt.Registry) error return nil } -// ContextValidate validate this previous consent session based on the context it is used -func (m *PreviousConsentSession) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConsentRequest(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrantAccessTokenAudience(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrantScope(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHandledAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSession(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PreviousConsentSession) contextValidateConsentRequest(ctx context.Context, formats strfmt.Registry) error { - - if m.ConsentRequest != nil { - if err := m.ConsentRequest.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("consent_request") - } - return err - } - } - - return nil -} - -func (m *PreviousConsentSession) contextValidateGrantAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GrantAccessTokenAudience.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_access_token_audience") - } - return err - } - - return nil -} - -func (m *PreviousConsentSession) contextValidateGrantScope(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GrantScope.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_scope") - } - return err - } - - return nil -} - -func (m *PreviousConsentSession) contextValidateHandledAt(ctx context.Context, formats strfmt.Registry) error { - - if err := m.HandledAt.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("handled_at") - } - return err - } - - return nil -} - -func (m *PreviousConsentSession) contextValidateSession(ctx context.Context, formats strfmt.Registry) error { - - if m.Session != nil { - if err := m.Session.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("session") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *PreviousConsentSession) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/reject_request.go b/internal/httpclient/models/reject_request.go index 42cf41b5228..37c02f35926 100644 --- a/internal/httpclient/models/reject_request.go +++ b/internal/httpclient/models/reject_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -43,11 +41,6 @@ func (m *RejectRequest) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this reject request based on context it is used -func (m *RejectRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *RejectRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/request_was_handled_response.go b/internal/httpclient/models/request_was_handled_response.go index 5430cd2ef03..1a224f2b3e8 100644 --- a/internal/httpclient/models/request_was_handled_response.go +++ b/internal/httpclient/models/request_was_handled_response.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -47,11 +45,6 @@ func (m *RequestWasHandledResponse) validateRedirectTo(formats strfmt.Registry) return nil } -// ContextValidate validates this request was handled response based on context it is used -func (m *RequestWasHandledResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *RequestWasHandledResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/string_slice_pipe_delimiter.go b/internal/httpclient/models/string_slice_pipe_delimiter.go index 76d7a757791..c7bc80e83c0 100644 --- a/internal/httpclient/models/string_slice_pipe_delimiter.go +++ b/internal/httpclient/models/string_slice_pipe_delimiter.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" ) @@ -20,8 +18,3 @@ type StringSlicePipeDelimiter []string func (m StringSlicePipeDelimiter) Validate(formats strfmt.Registry) error { return nil } - -// ContextValidate validates this string slice pipe delimiter based on context it is used -func (m StringSlicePipeDelimiter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/httpclient/models/userinfo_response.go b/internal/httpclient/models/userinfo_response.go index a78e76c3204..9b5fb8685fb 100644 --- a/internal/httpclient/models/userinfo_response.go +++ b/internal/httpclient/models/userinfo_response.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -80,11 +78,6 @@ func (m *UserinfoResponse) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this userinfo response based on context it is used -func (m *UserinfoResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *UserinfoResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/version.go b/internal/httpclient/models/version.go index 2a92642e537..8e687bcb20d 100644 --- a/internal/httpclient/models/version.go +++ b/internal/httpclient/models/version.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,11 +24,6 @@ func (m *Version) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this version based on context it is used -func (m *Version) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *Version) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/volume.go b/internal/httpclient/models/volume.go index a27d9734b32..d777e291958 100644 --- a/internal/httpclient/models/volume.go +++ b/internal/httpclient/models/volume.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -108,10 +106,6 @@ func (m *Volume) validateDriver(formats strfmt.Registry) error { func (m *Volume) validateLabels(formats strfmt.Registry) error { - if err := validate.Required("Labels", "body", m.Labels); err != nil { - return err - } - return nil } @@ -135,10 +129,6 @@ func (m *Volume) validateName(formats strfmt.Registry) error { func (m *Volume) validateOptions(formats strfmt.Registry) error { - if err := validate.Required("Options", "body", m.Options); err != nil { - return err - } - return nil } @@ -152,6 +142,7 @@ func (m *Volume) validateScope(formats strfmt.Registry) error { } func (m *Volume) validateUsageData(formats strfmt.Registry) error { + if swag.IsZero(m.UsageData) { // not required return nil } @@ -168,34 +159,6 @@ func (m *Volume) validateUsageData(formats strfmt.Registry) error { return nil } -// ContextValidate validate this volume based on the context it is used -func (m *Volume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUsageData(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Volume) contextValidateUsageData(ctx context.Context, formats strfmt.Registry) error { - - if m.UsageData != nil { - if err := m.UsageData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("UsageData") - } - return err - } - } - - return nil -} - // MarshalBinary interface implementation func (m *Volume) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/volume_usage_data.go b/internal/httpclient/models/volume_usage_data.go index bfae17367cf..886190c490b 100644 --- a/internal/httpclient/models/volume_usage_data.go +++ b/internal/httpclient/models/volume_usage_data.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -69,11 +67,6 @@ func (m *VolumeUsageData) validateSize(formats strfmt.Registry) error { return nil } -// ContextValidate validates this volume usage data based on context it is used -func (m *VolumeUsageData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *VolumeUsageData) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/well_known.go b/internal/httpclient/models/well_known.go index d06e5d74034..7641cc66a44 100644 --- a/internal/httpclient/models/well_known.go +++ b/internal/httpclient/models/well_known.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -23,7 +21,6 @@ import ( type WellKnown struct { // URL of the OP's OAuth 2.0 Authorization Endpoint. - // Example: https://playground.ory.sh/ory-hydra/public/oauth2/auth // Required: true AuthorizationEndpoint *string `json:"authorization_endpoint"` @@ -67,7 +64,6 @@ type WellKnown struct { // URL using the https scheme with no query or fragment component that the OP asserts as its IssuerURL Identifier. // If IssuerURL discovery is supported , this value MUST be identical to the issuer value returned // by WebFinger. This also MUST be identical to the iss Claim value in ID Tokens issued from this IssuerURL. - // Example: https://playground.ory.sh/ory-hydra/public/ // Required: true Issuer *string `json:"issuer"` @@ -78,12 +74,10 @@ type WellKnown struct { // Although some algorithms allow the same key to be used for both signatures and encryption, doing so is // NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of // keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate. - // Example: https://playground.ory.sh/ory-hydra/public/.well-known/jwks.json // Required: true JwksURI *string `json:"jwks_uri"` // URL of the OP's Dynamic Client Registration Endpoint. - // Example: https://playground.ory.sh/ory-hydra/admin/client RegistrationEndpoint string `json:"registration_endpoint,omitempty"` // JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for Request Objects, @@ -123,7 +117,6 @@ type WellKnown struct { SubjectTypesSupported []string `json:"subject_types_supported"` // URL of the OP's OAuth 2.0 Token Endpoint - // Example: https://playground.ory.sh/ory-hydra/public/oauth2/token // Required: true TokenEndpoint *string `json:"token_endpoint"` @@ -239,11 +232,6 @@ func (m *WellKnown) validateTokenEndpoint(formats strfmt.Registry) error { return nil } -// ContextValidate validates this well known based on context it is used -func (m *WellKnown) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *WellKnown) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/spec/api.json b/spec/api.json index 07259b8f97b..59f2aa944f6 100755 --- a/spec/api.json +++ b/spec/api.json @@ -91,7 +91,7 @@ }, "/clients": { "get": { - "description": "This endpoint lists all clients in the database, and never returns client secrets. As a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients, but it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.\nThe \"Link\" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '\u003chttps://hydra-url/admin/clients?limit={limit}\u0026offset={offset}\u003e; rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'.\nMultiple links can be included in this header, and will be separated by a comma.", + "description": "This endpoint lists all clients in the database, and never returns client secrets.\nAs a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients,\nbut it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.\n\nThe \"Link\" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '\u003chttps://hydra-url/admin/clients?limit={limit}\u0026offset={offset}\u003e; rel=\"{page}\"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'.\nMultiple links can be included in this header, and will be separated by a comma.", "consumes": [ "application/json" ], @@ -145,7 +145,7 @@ } } }, - "500": { + "default": { "description": "jsonError", "schema": { "$ref": "#/definitions/jsonError" @@ -154,7 +154,7 @@ } }, "post": { - "description": "Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "description": "Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret\nwill be generated. The secret will be returned in the response and you will not be able to retrieve it later on.\nWrite the secret down and keep it somwhere safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", "consumes": [ "application/json" ], @@ -187,19 +187,7 @@ "$ref": "#/definitions/oAuth2Client" } }, - "400": { - "description": "jsonError", - "schema": { - "$ref": "#/definitions/jsonError" - } - }, - "409": { - "description": "jsonError", - "schema": { - "$ref": "#/definitions/jsonError" - } - }, - "500": { + "default": { "description": "jsonError", "schema": { "$ref": "#/definitions/jsonError" @@ -210,7 +198,7 @@ }, "/clients/{id}": { "get": { - "description": "Get an OAUth 2.0 client by its ID. This endpoint never returns passwords.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "description": "Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", "consumes": [ "application/json" ], @@ -224,7 +212,7 @@ "tags": [ "admin" ], - "summary": "Get an OAuth 2.0 Client.", + "summary": "Get an OAuth 2.0 Client", "operationId": "getOAuth2Client", "parameters": [ { @@ -242,13 +230,7 @@ "$ref": "#/definitions/oAuth2Client" } }, - "401": { - "description": "jsonError", - "schema": { - "$ref": "#/definitions/jsonError" - } - }, - "500": { + "default": { "description": "jsonError", "schema": { "$ref": "#/definitions/jsonError" @@ -257,7 +239,7 @@ } }, "put": { - "description": "Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "description": "Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API.\nThis is the only time you will be able to retrieve the client secret, so write it down and keep it safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", "consumes": [ "application/json" ], @@ -296,7 +278,7 @@ "$ref": "#/definitions/oAuth2Client" } }, - "500": { + "default": { "description": "jsonError", "schema": { "$ref": "#/definitions/jsonError" @@ -305,7 +287,7 @@ } }, "delete": { - "description": "Delete an existing OAuth 2.0 Client by its ID.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "description": "Delete an existing OAuth 2.0 Client by its ID.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.\n\nMake sure that this endpoint is well protected and only callable by first-party components.", "consumes": [ "application/json" ], @@ -334,13 +316,7 @@ "204": { "description": "Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is\ntypically 201." }, - "404": { - "description": "jsonError", - "schema": { - "$ref": "#/definitions/jsonError" - } - }, - "500": { + "default": { "description": "jsonError", "schema": { "$ref": "#/definitions/jsonError" @@ -349,7 +325,7 @@ } }, "patch": { - "description": "Patch an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API. This is the only time you will be able to retrieve the client secret, so write it down and keep it safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.", + "description": "Patch an existing OAuth 2.0 Client. If you pass `client_secret`\nthe secret will be updated and returned via the API. This is the\nonly time you will be able to retrieve the client secret, so write it down and keep it safe.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", "consumes": [ "application/json" ], @@ -388,7 +364,7 @@ "$ref": "#/definitions/oAuth2Client" } }, - "500": { + "default": { "description": "jsonError", "schema": { "$ref": "#/definitions/jsonError" @@ -397,38 +373,159 @@ } } }, - "/grants/jwt-bearer/flush": { + "/connect/register": { + "get": { + "description": "This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the\npublic internet directly and can be used in self-service. It implements the OpenID Connect\nDynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint\nis disabled by default. It can be enabled by an administrator.\n\nTo use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client\nuses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query.\nIf it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "tags": [ + "public" + ], + "summary": "Get an OAuth 2.0 Client using OpenID Dynamic Client Registration", + "operationId": "selfServiceGetOAuth2Client", + "responses": { + "200": { + "description": "oAuth2Client", + "schema": { + "$ref": "#/definitions/oAuth2Client" + } + }, + "default": { + "description": "jsonError", + "schema": { + "$ref": "#/definitions/jsonError" + } + } + } + }, + "put": { + "description": "This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is capable of facing the\npublic internet directly and can be used in self-service. It implements the OpenID Connect\nDynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint\nis disabled by default. It can be enabled by an administrator.\n\nIf you pass `client_secret` the secret will be updated and returned via the API.\nThis is the only time you will be able to retrieve the client secret, so write it down and keep it safe.\n\nTo use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client\nuses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query.\nIf it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "tags": [ + "public" + ], + "summary": "Update an OAuth 2.0 Client using OpenID Dynamic Client Registration", + "operationId": "selfServiceUpdateOAuth2Client", + "parameters": [ + { + "type": "string", + "name": "client_id", + "in": "query", + "required": true + }, + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/oAuth2Client" + } + } + ], + "responses": { + "200": { + "description": "oAuth2Client", + "schema": { + "$ref": "#/definitions/oAuth2Client" + } + }, + "default": { + "description": "jsonError", + "schema": { + "$ref": "#/definitions/jsonError" + } + } + } + }, "post": { - "description": "This endpoint flushes expired jwt-bearer grants from the database. You can set a time after which no tokens will be\nnot be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be flushed as they are deleted\nautomatically when performing the refresh flow.", + "description": "This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the\npublic internet directly and can be used in self-service. It implements the OpenID Connect\nDynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint\nis disabled by default. It can be enabled by an administrator.\n\nCreate a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be\ngenerated. The secret will be returned in the response and you will not be able to retrieve it later on.\nWrite the secret down and keep it somewhere safe.", "consumes": [ "application/json" ], + "produces": [ + "application/json" + ], "schemes": [ "http", "https" ], "tags": [ - "admin" + "public" ], - "summary": "Flush Expired jwt-bearer grants.", - "operationId": "flushInactiveJwtBearerGrants", + "summary": "Register an OAuth 2.0 Client using OpenID Dynamic Client Registration", + "operationId": "selfServiceCreateOAuth2Client", "parameters": [ { "name": "Body", "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/flushInactiveJwtBearerGrantsParams" + "$ref": "#/definitions/oAuth2Client" } } ], + "responses": { + "201": { + "description": "oAuth2Client", + "schema": { + "$ref": "#/definitions/oAuth2Client" + } + }, + "default": { + "description": "jsonError", + "schema": { + "$ref": "#/definitions/jsonError" + } + } + } + }, + "delete": { + "description": "This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of facing the\npublic internet directly and can be used in self-service. It implements the OpenID Connect\nDynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint\nis disabled by default. It can be enabled by an administrator.\n\nTo use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client\nuses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query.\nIf it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "tags": [ + "public" + ], + "summary": "Deletes an OAuth 2.0 Client using OpenID Dynamic Client Registration", + "operationId": "selfServiceDeleteOAuth2Client", + "parameters": [ + { + "type": "string", + "name": "client_id", + "in": "query", + "required": true + } + ], "responses": { "204": { "description": "Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is\ntypically 201." }, - "500": { - "description": "genericError", + "default": { + "description": "jsonError", "schema": { - "$ref": "#/definitions/genericError" + "$ref": "#/definitions/jsonError" } } } @@ -2751,7 +2848,7 @@ } }, "Scope": { - "description": "The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level.", + "description": "The level at which the volume exists. Either `global` for cluster-wide,\nor `local` for machine level.", "type": "string" }, "Status": { @@ -2931,16 +3028,6 @@ } } }, - "flushInactiveJwtBearerGrantsParams": { - "type": "object", - "properties": { - "notAfter": { - "description": "The \"notAfter\" sets after which point grants should not be flushed. This is useful when you want to keep a history\nof recently added grants.", - "type": "string", - "format": "date-time" - } - } - }, "flushInactiveOAuth2TokensRequest": { "type": "object", "properties": { @@ -2973,6 +3060,10 @@ "type": "object", "additionalProperties": true }, + "id": { + "description": "The error ID\n\nUseful when trying to identify various errors in application logic.", + "type": "string" + }, "message": { "description": "Error message\n\nThe error's message.", "type": "string", diff --git a/spec/config.json b/spec/config.json index f5044ce6c52..b03fbbf88f3 100644 --- a/spec/config.json +++ b/spec/config.json @@ -357,12 +357,6 @@ }, "tls": { "$ref": "#/definitions/tls_config" - }, - "allow_dynamic_registration": { - "type": "boolean", - "additionalProperties": false, - "description": "Allow oidc dynamic client registration.", - "default": false } } }, @@ -563,6 +557,17 @@ "additionalProperties": false, "description": "Configures OpenID Connect features.", "properties": { + "dynamic_client_registration": { + "title": "Configure OpenID Connect Dynamic Client Registration", + "properties": { + "enable": { + "type": "boolean", + "description": "Enable dynamic client registration.", + "default": false + } + }, + "additionalProperties": false + }, "subject_identifiers": { "type": "object", "additionalProperties": false, From 601dcfe0a60ffdb487ee69e9f33de576f95a3495 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Sun, 2 Jan 2022 17:35:13 +0200 Subject: [PATCH 28/41] fix: return 404 on update endpoint when client is not found BREAKING CHANGE: Endpoint `PUT /clients` now returns a 404 error when the OAuth2 Client to be updated does not exist. It return 401 previously. --- client/sdk_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/sdk_test.go b/client/sdk_test.go index 36872f8bfda..f2ec7f909f7 100644 --- a/client/sdk_test.go +++ b/client/sdk_test.go @@ -131,7 +131,7 @@ func TestClientSDK(t *testing.T) { gresult, err = c.Admin.GetOAuth2Client(admin.NewGetOAuth2ClientParams().WithID("unknown")) require.Error(t, err) assert.Empty(t, gresult) - assert.True(t, strings.Contains(err.Error(), "401")) + assert.True(t, strings.Contains(err.Error(), "404"), err.Error()) // listing clients returns the only added one results, err := c.Admin.ListOAuth2Clients(admin.NewListOAuth2ClientsParams().WithLimit(pointerx.Int64(100))) From 9b7b78f0bec60ea6dc730da98e01e8a23ea3306e Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Sun, 2 Jan 2022 17:36:01 +0200 Subject: [PATCH 29/41] fix: use correct configuration spec --- driver/config/provider.go | 2 +- spec/config.json | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/driver/config/provider.go b/driver/config/provider.go index 17997cc5eda..c2c65f66e77 100644 --- a/driver/config/provider.go +++ b/driver/config/provider.go @@ -56,7 +56,7 @@ const ( KeyIssuerURL = "urls.self.issuer" KeyAccessTokenStrategy = "strategies.access_token" KeySubjectIdentifierAlgorithmSalt = "oidc.subject_identifiers.pairwise.salt" - KeyPublicAllowDynamicRegistration = "oidc.dynamic_client_registration.enable" + KeyPublicAllowDynamicRegistration = "oidc.dynamic_client_registration.enabled" KeyPKCEEnforced = "oauth2.pkce.enforced" KeyPKCEEnforcedForPublicClients = "oauth2.pkce.enforced_for_public_clients" KeyLogLevel = "log.level" diff --git a/spec/config.json b/spec/config.json index b03fbbf88f3..50a95e9e474 100644 --- a/spec/config.json +++ b/spec/config.json @@ -557,17 +557,6 @@ "additionalProperties": false, "description": "Configures OpenID Connect features.", "properties": { - "dynamic_client_registration": { - "title": "Configure OpenID Connect Dynamic Client Registration", - "properties": { - "enable": { - "type": "boolean", - "description": "Enable dynamic client registration.", - "default": false - } - }, - "additionalProperties": false - }, "subject_identifiers": { "type": "object", "additionalProperties": false, @@ -629,6 +618,11 @@ "additionalProperties": false, "description": "Configures OpenID Connect Dynamic Client Registration (exposed as admin endpoints /clients/...).", "properties": { + "enabled": { + "type": "boolean", + "description": "Enable dynamic client registration.", + "default": false + }, "default_scope": { "type": "array", "description": "The OpenID Connect Dynamic Client Registration specification has no concept of whitelisting OAuth 2.0 Scope. If you want to expose Dynamic Client Registration, you should set the default scope enabled for newly registered clients. Keep in mind that users can overwrite this default by setting the \"scope\" key in the registration payload, effectively disabling the concept of whitelisted scopes.", From c77d3c6c5b760a3cad33b616a423e8a1f99aef99 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Sun, 2 Jan 2022 17:36:25 +0200 Subject: [PATCH 30/41] chore: format --- ...id-connect-dynamic-client-registration.mdx | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/docs/docs/guides/openid-connect-dynamic-client-registration.mdx b/docs/docs/guides/openid-connect-dynamic-client-registration.mdx index 132462faaae..bd465b5d98e 100644 --- a/docs/docs/guides/openid-connect-dynamic-client-registration.mdx +++ b/docs/docs/guides/openid-connect-dynamic-client-registration.mdx @@ -3,10 +3,13 @@ id: openid-connect-dynamic-client-registration title: OpenID Connect Dynamic Client Registration --- -Ory Hydra is capable of exposing [OpenID Connect Dynamic Client Registration](https://openid.net/specs/openid-connect-registration-1_0.html). -This feature allows anonymous users to create OAuth2 Clients in self-service, without administrative privileges. +Ory Hydra is capable of exposing +[OpenID Connect Dynamic Client Registration](https://openid.net/specs/openid-connect-registration-1_0.html). +This feature allows anonymous users to create OAuth2 Clients in self-service, +without administrative privileges. -This is particularly useful if you are running a public service and want users to be able to create their own OAuth2 clients easily. +This is particularly useful if you are running a public service and want users +to be able to create their own OAuth2 clients easily. To enable this feature, set the following configuration option: @@ -16,7 +19,8 @@ oidc: enabled: true ``` -Enabling this feature will add listeners to the following four routes at the public endpoint: +Enabling this feature will add listeners to the following four routes at the +public endpoint: - `POST /openid/register` - Register a new OAuth2 Client; - `GET /openid/register?client_id=...` - Fetch the OAuth2 Client; @@ -25,7 +29,8 @@ Enabling this feature will add listeners to the following four routes at the pub ## Register OAuth2 & OpenID Connect Clients -If OpenID Connect Dynamic Client Registration is enabled, registering a new OAuth2 Client is as simple as: +If OpenID Connect Dynamic Client Registration is enabled, registering a new +OAuth2 Client is as simple as: ``` POST /openid/register @@ -37,14 +42,18 @@ Content-Type: application/json } ``` -Please note that it is not possible to set OAuth2 Client Metadata using this endpoint. Metadata is a protected -field and can only be set using the administrative endpoint! OAuth2 Client Metadata can also not be read using OpenID Connect Dynamic Client Registration endpoints! +Please note that it is not possible to set OAuth2 Client Metadata using this +endpoint. Metadata is a protected field and can only be set using the +administrative endpoint! OAuth2 Client Metadata can also not be read using +OpenID Connect Dynamic Client Registration endpoints! ## Manage OAuth2 & OpenID Connect Clients -All endpoints except the `POST` one require the client to authenticate with its primary credentials. For example, -if the OAuth2 Client has `token_endpoint_auth_method=client_secret_basic` then it will require the client to authenticate -using basic authorization when, for example, updating information: +All endpoints except the `POST` one require the client to authenticate with its +primary credentials. For example, if the OAuth2 Client has +`token_endpoint_auth_method=client_secret_basic` then it will require the client +to authenticate using basic authorization when, for example, updating +information: ``` PUT /openid/register?client_id=... @@ -57,7 +66,8 @@ Content-Type: application/json } ``` -If the OAuth2 Client uses `client_secret_post` as the auth method, you need to supply the client secret as a query parameter: +If the OAuth2 Client uses `client_secret_post` as the auth method, you need to +supply the client secret as a query parameter: ``` PUT /openid/register?client_id=...&client_secret=... @@ -69,7 +79,8 @@ Content-Type: application/json } ``` -If the OAuth2 Client uses `private_key_jwt` as the auth method, you supply the appropriate assertion as a query parameter as well: +If the OAuth2 Client uses `private_key_jwt` as the auth method, you supply the +appropriate assertion as a query parameter as well: ``` PUT /openid/register?client_id=...&client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&client_assertion=... @@ -83,8 +94,8 @@ Content-Type: application/json :::info -It is not possible to manage the OAuth2 Clients with `token_endpoint_auth_method=none` through the API! These clients can only be managed -using administrative endpoints. +It is not possible to manage the OAuth2 Clients with +`token_endpoint_auth_method=none` through the API! These clients can only be +managed using administrative endpoints. ::: - From 5d43bd09e84c702c6f0b016362a346077d96f309 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Sun, 2 Jan 2022 18:28:01 +0200 Subject: [PATCH 31/41] u --- internal/.hydra.yaml | 2 +- internal/config/config.yaml | 3 +-- test/e2e/circle-ci.bash | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/.hydra.yaml b/internal/.hydra.yaml index 11f47550e99..a94c722a7b0 100644 --- a/internal/.hydra.yaml +++ b/internal/.hydra.yaml @@ -27,7 +27,6 @@ serve: debug: false access_log: disable_for_health: false - allow_dynamic_registration: false admin: port: 2 host: localhost @@ -87,6 +86,7 @@ oidc: pairwise: salt: random_salt dynamic_client_registration: + enabled: false default_scope: - whatever diff --git a/internal/config/config.yaml b/internal/config/config.yaml index c0d8e3784de..dc6aeb2639b 100644 --- a/internal/config/config.yaml +++ b/internal/config/config.yaml @@ -141,8 +141,6 @@ serve: access_log: # Disable access log for health endpoints. disable_for_health: false - # Allow oidc dynamic client registration - allow_dynamic_registration: false # admin controls the admin daemon serving admin API endpoints like /jwk, /client, ... admin: @@ -315,6 +313,7 @@ oidc: # dynamic_client_registration configures OpenID Connect Dynamic Client Registration (exposed as admin endpoints /clients/...) dynamic_client_registration: + enabled: false # The OpenID Connect Dynamic Client Registration specification has no concept of whitelisting OAuth 2.0 Scope. If you # want to expose Dynamic Client Registration, you should set the default scope enabled for newly registered clients. diff --git a/test/e2e/circle-ci.bash b/test/e2e/circle-ci.bash index 131cb92a852..2ebd50ceee5 100755 --- a/test/e2e/circle-ci.bash +++ b/test/e2e/circle-ci.bash @@ -55,7 +55,7 @@ export SERVE_ADMIN_PORT=5001 export LOG_LEAK_SENSITIVE_VALUES=true export TEST_DATABASE_SQLITE="sqlite://$(mktemp -d -t ci-XXXXXXXXXX)/e2e.sqlite?_fk=true" -export SERVE_PUBLIC_ALLOW_DYNAMIC_REGISTRATION=true +export OIDC_DYNAMIC_CLIENT_REGISTRATION_ENABLED=true export TEST_DATABASE="$TEST_DATABASE_SQLITE" WATCH=no From 6894e19e426fbb50e8dcd9a61abc62372601970d Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 3 Jan 2022 15:49:04 +0200 Subject: [PATCH 32/41] feat: foo BREAKING CHANGES: This change requires you to run SQL migrations! --- README.md | 8 +- ...d=DELETE-with_a_different_client_auth.json | 2 +- ...elfservice-method=DELETE-without_auth.json | 2 +- ...-method=DELETE-without_incorrect_auth.json | 2 +- ...thod=GET-with_a_different_client_auth.json | 2 +- ...t=selfservice-method=GET-without_auth.json | 2 +- ...ice-method=GET-without_incorrect_auth.json | 2 +- ...thod=PUT-with_a_different_client_auth.json | 2 +- ...t=selfservice-method=PUT-without_auth.json | 2 +- ...ice-method=PUT-without_incorrect_auth.json | 2 +- ...ion=basic_dynamic_client_registration.json | 2 - ...-description=basic_admin_registration.json | 3 +- ...ription=short_secret_fails_for_admin.json} | 0 ...selfservice_because_it_is_overwritten.json | 23 ++ ...-path=-connect-register?client_id=foo.json | 7 - ...ing_client-path=-oauth2-register-foo.json} | 2 +- ...rent_self-service_auth_methods-case=0.json | 26 -- ...rent_self-service_auth_methods-case=3.json | 26 -- ...tching_existing_client-endpoint=admin.json | 2 +- ..._existing_client-endpoint=selfservice.json | 2 +- ...-path=-connect-register?client_id=foo.json | 7 - ...ing_client-path=-oauth2-register-foo.json} | 2 +- ...endpoint=dynamic_client_registration.json} | 0 ..._fails_with_metadata_on_self_service.json} | 0 ...-path=-connect-register?client_id=foo.json | 7 - ...ting_client-path=-oauth2-register-foo.json | 7 + ...er-create_client-case=0-dynamic=false.json | 21 ++ ...ler-create_client-case=1-dynamic=true.json | 19 ++ ...er-create_client-case=2-dynamic=false.json | 21 ++ ...er-create_client-case=3-dynamic=false.json | 22 ++ ...ler-create_client-case=4-dynamic=true.json | 19 ++ ...ler-create_client-case=5-dynamic=true.json | 19 ++ client/client.go | 9 + client/handler.go | 98 ++++--- client/handler_test.go | 252 +++++++++++------- client/registry.go | 5 +- client/sdk_test.go | 3 +- ...id-connect-dynamic-client-registration.mdx | 83 ++++-- driver/registry_base.go | 2 +- ...156000000000_dynamic_registration.down.sql | 1 + ...26156000000000_dynamic_registration.up.sql | 1 + 41 files changed, 460 insertions(+), 257 deletions(-) rename client/.snapshots/{TestHandler-common-case=create_clients-case=3-description=short_secret_fails.json => TestHandler-common-case=create_clients-case=3-description=short_secret_fails_for_admin.json} (100%) create mode 100644 client/.snapshots/TestHandler-common-case=create_clients-case=4-description=short_secret_succeeds_for_selfservice_because_it_is_overwritten.json delete mode 100644 client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-connect-register?client_id=foo.json rename client/.snapshots/{TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=1.json => TestHandler-common-case=delete_non-existing_client-path=-oauth2-register-foo.json} (72%) delete mode 100644 client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=0.json delete mode 100644 client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=3.json delete mode 100644 client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-connect-register?client_id=foo.json rename client/.snapshots/{TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=2.json => TestHandler-common-case=fetching_non-existing_client-path=-oauth2-register-foo.json} (72%) rename client/.snapshots/{TestHandler-common-case=updating_existing_client-endpoint=selfservice.json => TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration.json} (100%) rename client/.snapshots/{TestHandler-common-case=updating_existing_client_fails_with_metadat_on_self_service.json => TestHandler-common-case=updating_existing_client_fails_with_metadata_on_self_service.json} (100%) delete mode 100644 client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-connect-register?client_id=foo.json create mode 100644 client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-oauth2-register-foo.json create mode 100644 client/.snapshots/TestHandler-create_client-case=0-dynamic=false.json create mode 100644 client/.snapshots/TestHandler-create_client-case=1-dynamic=true.json create mode 100644 client/.snapshots/TestHandler-create_client-case=2-dynamic=false.json create mode 100644 client/.snapshots/TestHandler-create_client-case=3-dynamic=false.json create mode 100644 client/.snapshots/TestHandler-create_client-case=4-dynamic=true.json create mode 100644 client/.snapshots/TestHandler-create_client-case=5-dynamic=true.json create mode 100644 persistence/sql/migrations/20211226156000000000_dynamic_registration.down.sql create mode 100644 persistence/sql/migrations/20211226156000000000_dynamic_registration.up.sql diff --git a/README.md b/README.md index 335c7a6c140..ca5b346e99f 100644 --- a/README.md +++ b/README.md @@ -196,7 +196,7 @@ that your company deserves a spot here, reach out to Zero Project Zero by Commit getzero.dev - + Adopter * Padis @@ -214,7 +214,7 @@ that your company deserves a spot here, reach out to Security Onion Solutions Security Onion Solutions securityonionsolutions.com - + Adopter * Factly @@ -238,7 +238,7 @@ that your company deserves a spot here, reach out to Spiri.bo Spiri.bo spiri.bo - + Sponsor Strivacity @@ -274,6 +274,8 @@ ORY Hydra implements Open Standards set by the IETF: * [OAuth 2.0 Token Revocation](https://tools.ietf.org/html/rfc7009) * [OAuth 2.0 Token Introspection](https://tools.ietf.org/html/rfc7662) * [OAuth 2.0 for Native Apps](https://tools.ietf.org/html/draft-ietf-oauth-native-apps-10) +* [OAuth 2.0 Dynamic Client Registration Protocol](https://datatracker.ietf.org/doc/html/rfc7591) +* [OAuth 2.0 Dynamic Client Registration Management Protocol](https://datatracker.ietf.org/doc/html/rfc7592) * [Proof Key for Code Exchange by OAuth Public Clients](https://tools.ietf.org/html/rfc7636) * [JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants](https://tools.ietf.org/html/rfc7523) diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-with_a_different_client_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-with_a_different_client_auth.json index 5e96525286a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-with_a_different_client_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-with_a_different_client_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_auth.json index 73cb36f365a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_incorrect_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_incorrect_auth.json index 73cb36f365a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_incorrect_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=DELETE-without_incorrect_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-with_a_different_client_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-with_a_different_client_auth.json index 5e96525286a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-with_a_different_client_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-with_a_different_client_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json index 73cb36f365a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json index 73cb36f365a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=GET-without_incorrect_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-with_a_different_client_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-with_a_different_client_auth.json index 5e96525286a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-with_a_different_client_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-with_a_different_client_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json index 73cb36f365a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json index 73cb36f365a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json +++ b/client/.snapshots/TestHandler-case=selfservice_with_incorrect_or_missing_auth-endpoint=selfservice-method=PUT-without_incorrect_auth.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=basic_dynamic_client_registration.json b/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=basic_dynamic_client_registration.json index 5a7a1b92cbb..9b2ef8e0beb 100644 --- a/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=basic_dynamic_client_registration.json +++ b/client/.snapshots/TestHandler-common-case=create_clients-case=0-description=basic_dynamic_client_registration.json @@ -1,7 +1,5 @@ { - "client_id": "create-client-1", "client_name": "", - "client_secret": "averylongsecret", "redirect_uris": [ "http://localhost:3000/cb" ], diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=basic_admin_registration.json b/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=basic_admin_registration.json index 6552f5a15e8..4876ac9c0de 100644 --- a/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=basic_admin_registration.json +++ b/client/.snapshots/TestHandler-common-case=create_clients-case=1-description=basic_admin_registration.json @@ -23,5 +23,6 @@ "userinfo_signed_response_alg": "none", "metadata": { "foo": "bar" - } + }, + "registration_client_uri": "http://localhost:4444/oauth2/register/create-client-2" } diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=3-description=short_secret_fails.json b/client/.snapshots/TestHandler-common-case=create_clients-case=3-description=short_secret_fails_for_admin.json similarity index 100% rename from client/.snapshots/TestHandler-common-case=create_clients-case=3-description=short_secret_fails.json rename to client/.snapshots/TestHandler-common-case=create_clients-case=3-description=short_secret_fails_for_admin.json diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=4-description=short_secret_succeeds_for_selfservice_because_it_is_overwritten.json b/client/.snapshots/TestHandler-common-case=create_clients-case=4-description=short_secret_succeeds_for_selfservice_because_it_is_overwritten.json new file mode 100644 index 00000000000..9b2ef8e0beb --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=create_clients-case=4-description=short_secret_succeeds_for_selfservice_because_it_is_overwritten.json @@ -0,0 +1,23 @@ +{ + "client_name": "", + "redirect_uris": [ + "http://localhost:3000/cb" + ], + "grant_types": null, + "response_types": null, + "scope": "offline_access offline openid", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "public", + "jwks": {}, + "token_endpoint_auth_method": "client_secret_basic", + "userinfo_signed_response_alg": "none", + "metadata": {} +} diff --git a/client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-connect-register?client_id=foo.json b/client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-connect-register?client_id=foo.json deleted file mode 100644 index 5e96525286a..00000000000 --- a/client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-connect-register?client_id=foo.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "body": { - "error": "The request could not be authorized", - "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." - }, - "status": 401 -} diff --git a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=1.json b/client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-oauth2-register-foo.json similarity index 72% rename from client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=1.json rename to client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-oauth2-register-foo.json index 73cb36f365a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=1.json +++ b/client/.snapshots/TestHandler-common-case=delete_non-existing_client-path=-oauth2-register-foo.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=0.json b/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=0.json deleted file mode 100644 index 77ff70f8101..00000000000 --- a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=0.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "body": { - "client_id": "get-client-auth-1", - "client_name": "", - "redirect_uris": [ - "http://localhost:3000/cb" - ], - "grant_types": [], - "response_types": [], - "scope": "offline_access offline openid", - "audience": [], - "owner": "", - "policy_uri": "", - "allowed_cors_origins": [], - "tos_uri": "", - "client_uri": "", - "logo_uri": "", - "contacts": [], - "client_secret_expires_at": 0, - "subject_type": "public", - "jwks": {}, - "token_endpoint_auth_method": "client_secret_basic", - "userinfo_signed_response_alg": "none" - }, - "status": 200 -} diff --git a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=3.json b/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=3.json deleted file mode 100644 index 3745d0bac05..00000000000 --- a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=3.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "body": { - "client_id": "get-client-auth-4", - "client_name": "", - "redirect_uris": [ - "http://localhost:3000/cb" - ], - "grant_types": [], - "response_types": [], - "scope": "offline_access offline openid", - "audience": [], - "owner": "", - "policy_uri": "", - "allowed_cors_origins": [], - "tos_uri": "", - "client_uri": "", - "logo_uri": "", - "contacts": [], - "client_secret_expires_at": 0, - "subject_type": "public", - "jwks": {}, - "token_endpoint_auth_method": "client_secret_post", - "userinfo_signed_response_alg": "none" - }, - "status": 200 -} diff --git a/client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=admin.json b/client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=admin.json index 4c93678aba6..12b3874a129 100644 --- a/client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=admin.json +++ b/client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=admin.json @@ -1,6 +1,6 @@ { "body": { - "client_id": "existing-client", + "client_id": "existing-client-fetch", "client_name": "", "redirect_uris": [ "http://localhost:3000/cb" diff --git a/client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=selfservice.json b/client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=selfservice.json index 56d8f4de4f3..526b2ff51db 100644 --- a/client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=selfservice.json +++ b/client/.snapshots/TestHandler-common-case=fetching_existing_client-endpoint=selfservice.json @@ -1,6 +1,6 @@ { "body": { - "client_id": "existing-client", + "client_id": "existing-client-fetch", "client_name": "", "redirect_uris": [ "http://localhost:3000/cb" diff --git a/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-connect-register?client_id=foo.json b/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-connect-register?client_id=foo.json deleted file mode 100644 index 5e96525286a..00000000000 --- a/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-connect-register?client_id=foo.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "body": { - "error": "The request could not be authorized", - "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." - }, - "status": 401 -} diff --git a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=2.json b/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-oauth2-register-foo.json similarity index 72% rename from client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=2.json rename to client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-oauth2-register-foo.json index 73cb36f365a..3fe5e5fbdfe 100644 --- a/client/.snapshots/TestHandler-common-case=fetch_with_different_self-service_auth_methods-case=2.json +++ b/client/.snapshots/TestHandler-common-case=fetching_non-existing_client-path=-oauth2-register-foo.json @@ -1,7 +1,7 @@ { "body": { "error": "The request could not be authorized", - "error_description": "The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials." + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." }, "status": 401 } diff --git a/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=selfservice.json b/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration.json similarity index 100% rename from client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=selfservice.json rename to client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration.json diff --git a/client/.snapshots/TestHandler-common-case=updating_existing_client_fails_with_metadat_on_self_service.json b/client/.snapshots/TestHandler-common-case=updating_existing_client_fails_with_metadata_on_self_service.json similarity index 100% rename from client/.snapshots/TestHandler-common-case=updating_existing_client_fails_with_metadat_on_self_service.json rename to client/.snapshots/TestHandler-common-case=updating_existing_client_fails_with_metadata_on_self_service.json diff --git a/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-connect-register?client_id=foo.json b/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-connect-register?client_id=foo.json deleted file mode 100644 index 5e96525286a..00000000000 --- a/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-connect-register?client_id=foo.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "body": { - "error": "The request could not be authorized", - "error_description": "The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request." - }, - "status": 401 -} diff --git a/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-oauth2-register-foo.json b/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-oauth2-register-foo.json new file mode 100644 index 00000000000..3fe5e5fbdfe --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=updating_non-existing_client-path=-oauth2-register-foo.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The request could not be authorized", + "error_description": "The requested OAuth 2.0 client does not exist or you provided incorrect credentials." + }, + "status": 401 +} diff --git a/client/.snapshots/TestHandler-create_client-case=0-dynamic=false.json b/client/.snapshots/TestHandler-create_client-case=0-dynamic=false.json new file mode 100644 index 00000000000..113273781db --- /dev/null +++ b/client/.snapshots/TestHandler-create_client-case=0-dynamic=false.json @@ -0,0 +1,21 @@ +{ + "client_id": "create-client-0", + "client_name": "", + "redirect_uris": null, + "grant_types": null, + "response_types": null, + "scope": "", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "", + "jwks": {}, + "metadata": {}, + "registration_client_uri": "http://localhost:4444/oauth2/register/create-client-0" +} diff --git a/client/.snapshots/TestHandler-create_client-case=1-dynamic=true.json b/client/.snapshots/TestHandler-create_client-case=1-dynamic=true.json new file mode 100644 index 00000000000..8d54b6f7df3 --- /dev/null +++ b/client/.snapshots/TestHandler-create_client-case=1-dynamic=true.json @@ -0,0 +1,19 @@ +{ + "client_name": "", + "redirect_uris": null, + "grant_types": null, + "response_types": null, + "scope": "", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "", + "jwks": {}, + "metadata": {} +} diff --git a/client/.snapshots/TestHandler-create_client-case=2-dynamic=false.json b/client/.snapshots/TestHandler-create_client-case=2-dynamic=false.json new file mode 100644 index 00000000000..4af9626078a --- /dev/null +++ b/client/.snapshots/TestHandler-create_client-case=2-dynamic=false.json @@ -0,0 +1,21 @@ +{ + "client_id": "create-client-1", + "client_name": "", + "redirect_uris": null, + "grant_types": null, + "response_types": null, + "scope": "", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "", + "jwks": {}, + "metadata": {}, + "registration_client_uri": "http://localhost:4444/oauth2/register/create-client-1" +} diff --git a/client/.snapshots/TestHandler-create_client-case=3-dynamic=false.json b/client/.snapshots/TestHandler-create_client-case=3-dynamic=false.json new file mode 100644 index 00000000000..47c5f10d932 --- /dev/null +++ b/client/.snapshots/TestHandler-create_client-case=3-dynamic=false.json @@ -0,0 +1,22 @@ +{ + "client_id": "", + "client_name": "", + "client_secret": "create-client-2", + "redirect_uris": null, + "grant_types": null, + "response_types": null, + "scope": "", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "", + "jwks": {}, + "metadata": {}, + "registration_client_uri": "http://localhost:4444/oauth2/register/" +} diff --git a/client/.snapshots/TestHandler-create_client-case=4-dynamic=true.json b/client/.snapshots/TestHandler-create_client-case=4-dynamic=true.json new file mode 100644 index 00000000000..8d54b6f7df3 --- /dev/null +++ b/client/.snapshots/TestHandler-create_client-case=4-dynamic=true.json @@ -0,0 +1,19 @@ +{ + "client_name": "", + "redirect_uris": null, + "grant_types": null, + "response_types": null, + "scope": "", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "", + "jwks": {}, + "metadata": {} +} diff --git a/client/.snapshots/TestHandler-create_client-case=5-dynamic=true.json b/client/.snapshots/TestHandler-create_client-case=5-dynamic=true.json new file mode 100644 index 00000000000..8d54b6f7df3 --- /dev/null +++ b/client/.snapshots/TestHandler-create_client-case=5-dynamic=true.json @@ -0,0 +1,19 @@ +{ + "client_name": "", + "redirect_uris": null, + "grant_types": null, + "response_types": null, + "scope": "", + "audience": [], + "owner": "", + "policy_uri": "", + "allowed_cors_origins": [], + "tos_uri": "", + "client_uri": "", + "logo_uri": "", + "contacts": null, + "client_secret_expires_at": 0, + "subject_type": "", + "jwks": {}, + "metadata": {} +} diff --git a/client/client.go b/client/client.go index feb140e002c..5a2b3ff28fd 100644 --- a/client/client.go +++ b/client/client.go @@ -198,6 +198,15 @@ type Client struct { // Metadata is arbitrary data. Metadata sqlxx.JSONRawMessage `json:"metadata,omitempty" db:"metadata"` + + // RegistrationAccessTokenSignature is contains the signature of the registration token for managing the OAuth2 Client. + RegistrationAccessTokenSignature string `json:"-" db:"registration_access_token_signature"` + + // RegistrationAccessToken can be used to update, get, or delete the OAuth2 Client. + RegistrationAccessToken string `json:"registration_access_token,omitempty" db:"-"` + + // RegistrationClientURI is the URL used to update, get, or delete the OAuth2 Client. + RegistrationClientURI string `json:"registration_client_uri,omitempty" db:"-"` } func (Client) TableName() string { diff --git a/client/handler.go b/client/handler.go index 14eded6a16c..955495684f4 100644 --- a/client/handler.go +++ b/client/handler.go @@ -22,11 +22,16 @@ package client import ( "context" + "crypto/subtle" "encoding/json" "io" "net/http" "time" + "github.com/pborman/uuid" + + "github.com/ory/x/urlx" + "github.com/ory/fosite" "github.com/ory/x/errorsx" @@ -46,7 +51,7 @@ type Handler struct { const ( ClientsHandlerPath = "/clients" - DynClientsHandlerPath = "/connect/register" + DynClientsHandlerPath = "/oauth2/register" ) func NewHandler(r InternalRegistry) *Handler { @@ -55,7 +60,7 @@ func NewHandler(r InternalRegistry) *Handler { } } -func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic, dynamicRegistration bool) { +func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic) { admin.GET(ClientsHandlerPath, h.List) admin.POST(ClientsHandlerPath, h.Create) admin.GET(ClientsHandlerPath+"/:id", h.Get) @@ -63,11 +68,11 @@ func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic, dynami admin.PATCH(ClientsHandlerPath+"/:id", h.Patch) admin.DELETE(ClientsHandlerPath+"/:id", h.Delete) - if dynamicRegistration { + if h.r.Config().PublicAllowDynamicRegistration() { public.POST(DynClientsHandlerPath, h.CreateDynamicRegistration) - public.GET(DynClientsHandlerPath, h.GetDynamicRegistration) - public.PUT(DynClientsHandlerPath, h.UpdateDynamicRegistration) - public.DELETE(DynClientsHandlerPath, h.DeleteDynamicRegistration) + public.GET(DynClientsHandlerPath+"/:id", h.GetDynamicRegistration) + public.PUT(DynClientsHandlerPath+"/:id", h.UpdateDynamicRegistration) + public.DELETE(DynClientsHandlerPath+"/:id", h.DeleteDynamicRegistration) } } @@ -94,7 +99,7 @@ func (h *Handler) SetRoutes(admin *x.RouterAdmin, public *x.RouterPublic, dynami // 201: oAuth2Client // default: jsonError func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { - c, err := h.create(w, r, h.r.ClientValidator().Validate) + c, err := h.CreateClient(r, h.r.ClientValidator().Validate, false) if err != nil { h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) return @@ -103,17 +108,20 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Pa h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &c) } -// swagger:route POST /connect/register public selfServiceCreateOAuth2Client +// swagger:route POST /connect/register public dynamicClientRegistrationCreateOAuth2Client // -// Register an OAuth 2.0 Client using OpenID Dynamic Client Registration +// Register an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol // // This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the // public internet directly and can be used in self-service. It implements the OpenID Connect // Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint // is disabled by default. It can be enabled by an administrator. // -// Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be -// generated. The secret will be returned in the response and you will not be able to retrieve it later on. +// Please note that using this endpoint you are not able to choose the `client_secret` nor the `client_id` as those +// values will be server generated when specifying `token_endpoint_auth_method` as `client_secret_basic` or +// `client_secret_post`. +// +// The `client_secret` will be returned in the response and you will not be able to retrieve it later on. // Write the secret down and keep it somewhere safe. // // @@ -129,7 +137,7 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Pa // 201: oAuth2Client // default: jsonError func (h *Handler) CreateDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - c, err := h.create(w, r, h.r.ClientValidator().ValidateDynamicRegistration) + c, err := h.CreateClient(r, h.r.ClientValidator().ValidateDynamicRegistration, true) if err != nil { h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) return @@ -138,13 +146,18 @@ func (h *Handler) CreateDynamicRegistration(w http.ResponseWriter, r *http.Reque h.r.Writer().WriteCreated(w, r, ClientsHandlerPath+"/"+c.GetID(), &c) } -func (h *Handler) create(w http.ResponseWriter, r *http.Request, validator func(*Client) error) (*Client, error) { +func (h *Handler) CreateClient(r *http.Request, validator func(*Client) error, isDynamic bool) (*Client, error) { var c Client if err := json.NewDecoder(r.Body).Decode(&c); err != nil { return nil, err } + if isDynamic { + c.OutfacingID = uuid.New() + c.Secret = "" + } + if len(c.Secret) == 0 { secretb, err := x.GenerateSecret(26) if err != nil { @@ -160,6 +173,16 @@ func (h *Handler) create(w http.ResponseWriter, r *http.Request, validator func( secret := c.Secret c.CreatedAt = time.Now().UTC().Round(time.Second) c.UpdatedAt = c.CreatedAt + + token, signature, err := h.r.OAuth2HMACStrategy().GenerateAccessToken(nil, nil) + if err != nil { + return nil, err + } + + c.RegistrationAccessToken = token + c.RegistrationAccessTokenSignature = signature + c.RegistrationClientURI = urlx.AppendPaths(h.r.Config().PublicURL(), DynClientsHandlerPath+"/"+c.OutfacingID).String() + if err := h.r.ClientManager().CreateClient(r.Context(), &c); err != nil { return nil, err } @@ -226,9 +249,9 @@ func (h *Handler) updateClient(ctx context.Context, c *Client, validator func(*C return nil } -// swagger:route PUT /connect/register public selfServiceUpdateOAuth2Client +// swagger:route PUT /connect/register/{id} public dynamicClientRegistrationUpdateOAuth2Client // -// Update an OAuth 2.0 Client using OpenID Dynamic Client Registration +// Update an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol // // This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is capable of facing the // public internet directly and can be used in self-service. It implements the OpenID Connect @@ -258,7 +281,7 @@ func (h *Handler) updateClient(ctx context.Context, c *Client, validator func(*C // default: jsonError // func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - client, err := h.validDynamicAuth(r) + client, err := h.ValidDynamicAuth(r, ps) if err != nil { h.r.Writer().WriteError(w, r, err) return @@ -266,9 +289,18 @@ func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Reque var c Client if err := json.NewDecoder(r.Body).Decode(&c); err != nil { - h.r.Writer().WriteError(w, r, errorsx.WithStack(err)) + h.r.Writer().WriteError(w, r, errorsx.WithStack(herodot.ErrBadRequest.WithReasonf("Unable to decode the request body. Is it valid JSON?").WithDebug(err.Error()))) + return + } + + // Regenerate the registration access token + token, signature, err := h.r.OAuth2HMACStrategy().GenerateAccessToken(nil, nil) + if err != nil { + h.r.Writer().WriteError(w, r, err) return } + c.RegistrationAccessToken = token + c.RegistrationAccessTokenSignature = signature c.OutfacingID = client.GetID() if err := h.updateClient(r.Context(), &c, h.r.ClientValidator().ValidateDynamicRegistration); err != nil { @@ -449,9 +481,9 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para h.r.Writer().Write(w, r, c) } -// swagger:route GET /connect/register public selfServiceGetOAuth2Client +// swagger:route GET /connect/register/{id} public dynamicClientRegistrationGetOAuth2Client // -// Get an OAuth 2.0 Client using OpenID Dynamic Client Registration +// Get an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol // // This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the // public internet directly and can be used in self-service. It implements the OpenID Connect @@ -477,7 +509,7 @@ func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Para // 200: oAuth2Client // default: jsonError func (h *Handler) GetDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - client, err := h.validDynamicAuth(r) + client, err := h.ValidDynamicAuth(r, ps) if err != nil { h.r.Writer().WriteError(w, r, err) return @@ -527,9 +559,9 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P w.WriteHeader(http.StatusNoContent) } -// swagger:route DELETE /connect/register public selfServiceDeleteOAuth2Client +// swagger:route DELETE /connect/register/{id} public dynamicClientRegistrationDeleteOAuth2Client // -// Deletes an OAuth 2.0 Client using OpenID Dynamic Client Registration +// Deletes an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol // // This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of facing the // public internet directly and can be used in self-service. It implements the OpenID Connect @@ -552,7 +584,7 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P // 204: emptyResponse // default: jsonError func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { - client, err := h.validDynamicAuth(r) + client, err := h.ValidDynamicAuth(r, ps) if err != nil { h.r.Writer().WriteError(w, r, err) return @@ -566,21 +598,25 @@ func (h *Handler) DeleteDynamicRegistration(w http.ResponseWriter, r *http.Reque w.WriteHeader(http.StatusNoContent) } -func (h *Handler) validDynamicAuth(r *http.Request) (fosite.Client, error) { - // We use the query parameters instead of the body because the body is not available in this context. - c, err := h.r.ClientAuthenticator().AuthenticateClient(r.Context(), r, r.URL.Query()) +func (h *Handler) ValidDynamicAuth(r *http.Request, ps httprouter.Params) (fosite.Client, error) { + c, err := h.r.ClientManager().GetConcreteClient(r.Context(), ps.ByName("id")) if err != nil { return nil, herodot.ErrUnauthorized. WithTrace(err). - WithReason("The requested OAuth 2.0 client does not exist or you did not provide the necessary credentials.").WithDebug(err.Error()) + WithReason("The requested OAuth 2.0 client does not exist or you provided incorrect credentials.").WithDebug(err.Error()) } - if r.URL.Query().Get("client_id") != c.GetID() { - return nil, errors.WithStack(herodot.ErrUnauthorized.WithReason("The OAuth 2.0 Client ID from the path does not match the OAuth 2.0 Client used to authenticate the request.")) + token := fosite.AccessTokenFromRequest(r) + if err := h.r.OAuth2HMACStrategy().Enigma.Validate(token); err != nil { + return nil, herodot.ErrUnauthorized. + WithTrace(err). + WithReason("The requested OAuth 2.0 client does not exist or you provided incorrect credentials.").WithDebug(err.Error()) } - if c.(fosite.OpenIDConnectClient).GetTokenEndpointAuthMethod() == "none" { - return nil, errors.WithStack(herodot.ErrUnauthorized.WithReason("Public OAuth 2.0 Clients can not be managed using OpenID Connect Dynamic Client Registration.")) + signature := h.r.OAuth2HMACStrategy().Enigma.Signature(token) + if subtle.ConstantTimeCompare([]byte(c.RegistrationAccessTokenSignature), []byte(signature)) == 0 { + return nil, errors.WithStack(herodot.ErrUnauthorized. + WithReason("The requested OAuth 2.0 client does not exist or you provided incorrect credentials.").WithDebug("Registration access tokens do not match.")) } return c, nil diff --git a/client/handler_test.go b/client/handler_test.go index b80e8939016..aa1d778cb92 100644 --- a/client/handler_test.go +++ b/client/handler_test.go @@ -9,6 +9,10 @@ import ( "net/http/httptest" "testing" + "github.com/tidwall/gjson" + + "github.com/ory/hydra/driver/config" + "github.com/julienschmidt/httprouter" "github.com/stretchr/testify/assert" @@ -37,9 +41,84 @@ func TestHandler(t *testing.T) { reg := internal.NewMockedRegistry(t) h := client.NewHandler(reg) + t.Run("create client", func(t *testing.T) { + for k, tc := range []struct { + c *client.Client + dynamic bool + }{ + {c: &client.Client{OutfacingID: "create-client-0"}}, + {dynamic: true, c: new(client.Client)}, + {c: &client.Client{OutfacingID: "create-client-1"}}, + {c: &client.Client{Secret: "create-client-2"}}, + {c: &client.Client{OutfacingID: "create-client-3"}, dynamic: true}, + {c: &client.Client{Secret: "create-client-4"}, dynamic: true}, + } { + t.Run(fmt.Sprintf("case=%d/dynamic=%v", k, tc.dynamic), func(t *testing.T) { + var b bytes.Buffer + require.NoError(t, json.NewEncoder(&b).Encode(tc.c)) + r, err := http.NewRequest("POST", "/openid/registration", &b) + require.NoError(t, err) + + hadSecret := len(tc.c.Secret) > 0 + c, err := h.CreateClient(r, func(c *client.Client) error { + return nil + }, tc.dynamic) + require.NoError(t, err) + + except := []string{"registration_access_token", "updated_at", "created_at"} + require.NotEmpty(t, c.RegistrationAccessToken) + require.NotEqual(t, c.RegistrationAccessTokenSignature, c.RegistrationAccessToken) + if !hadSecret { + require.NotEmpty(t, c.Secret) + except = append(except, "client_secret") + } + + if tc.dynamic { + require.NotEmpty(t, c.OutfacingID) + assert.Equal(t, reg.Config().PublicURL().String()+"oauth2/register/"+c.OutfacingID, c.RegistrationClientURI) + except = append(except, "client_id", "client_secret", "registration_client_uri") + } + + snapshotx.SnapshotTExcept(t, c, except) + }) + } + }) + + t.Run("dynamic client registration protocol authentication", func(t *testing.T) { + r, err := http.NewRequest("POST", "/openid/registration", bytes.NewBufferString("{}")) + require.NoError(t, err) + expected, err := h.CreateClient(r, func(c *client.Client) error { + return nil + }, true) + require.NoError(t, err) + + t.Run("valid auth", func(t *testing.T) { + actual, err := h.ValidDynamicAuth(&http.Request{Header: http.Header{"Authorization": {"Bearer " + expected.RegistrationAccessToken}}}, httprouter.Params{ + httprouter.Param{Key: "id", Value: expected.OutfacingID}, + }) + require.NoError(t, err, "authentication with registration access token works") + assert.EqualValues(t, expected.GetID(), actual.GetID()) + }) + + t.Run("missing auth", func(t *testing.T) { + _, err := h.ValidDynamicAuth(&http.Request{}, httprouter.Params{ + httprouter.Param{Key: "id", Value: expected.OutfacingID}, + }) + require.Error(t, err, "authentication without registration access token fails") + }) + + t.Run("incorrect auth", func(t *testing.T) { + _, err := h.ValidDynamicAuth(&http.Request{Header: http.Header{"Authorization": {"Bearer invalid"}}}, httprouter.Params{ + httprouter.Param{Key: "id", Value: expected.OutfacingID}, + }) + require.Error(t, err, "authentication with invalid registration access token fails") + }) + }) + newServer := func(t *testing.T, dynamicEnabled bool) (*httptest.Server, *http.Client) { + require.NoError(t, reg.Config().Set(config.KeyPublicAllowDynamicRegistration, dynamicEnabled)) router := httprouter.New() - h.SetRoutes(&x.RouterAdmin{Router: router}, &x.RouterPublic{Router: router}, dynamicEnabled) + h.SetRoutes(&x.RouterAdmin{Router: router}, &x.RouterPublic{Router: router}) ts := httptest.NewServer(router) t.Cleanup(ts.Close) return ts, ts.Client() @@ -54,10 +133,10 @@ func TestHandler(t *testing.T) { return string(body), res } - fetchWithAuth := func(t *testing.T, method, url, username, password string, body io.Reader) (string, *http.Response) { + fetchWithBearerAuth := func(t *testing.T, method, url, token string, body io.Reader) (string, *http.Response) { r, err := http.NewRequest(method, url, body) require.NoError(t, err) - r.SetBasicAuth(username, password) + r.Header.Set("Authorization", "Bearer "+token) res, err := http.DefaultClient.Do(r) require.NoError(t, err) defer res.Body.Close() @@ -80,9 +159,10 @@ func TestHandler(t *testing.T) { return string(rb), res } - createClient := func(t *testing.T, c *client.Client, ts *httptest.Server, path string) { + createClient := func(t *testing.T, c *client.Client, ts *httptest.Server, path string) string { body, res := makeJSON(t, ts, "POST", path, c) require.Equal(t, http.StatusCreated, res.StatusCode, body) + return body } t.Run("selfservice disabled", func(t *testing.T) { @@ -122,7 +202,7 @@ func TestHandler(t *testing.T) { for _, method := range []string{"GET", "DELETE", "PUT"} { t.Run("method="+method, func(t *testing.T) { t.Run("without auth", func(t *testing.T) { - req, err := http.NewRequest(method, ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, nil) + req, err := http.NewRequest(method, ts.URL+client.DynClientsHandlerPath+"/"+expected.OutfacingID, nil) require.NoError(t, err) res, err := hc.Do(req) @@ -136,13 +216,13 @@ func TestHandler(t *testing.T) { }) t.Run("without incorrect auth", func(t *testing.T) { - body, res := fetchWithAuth(t, method, ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, "incorrect", nil) + body, res := fetchWithBearerAuth(t, method, ts.URL+client.DynClientsHandlerPath+"/"+expected.OutfacingID, "incorrect", nil) assert.Equal(t, http.StatusUnauthorized, res.StatusCode) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) }) t.Run("with a different client auth", func(t *testing.T) { - body, res := fetchWithAuth(t, method, ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, secondClient.OutfacingID, secondClient.Secret, nil) + body, res := fetchWithBearerAuth(t, method, ts.URL+client.DynClientsHandlerPath+"/"+expected.OutfacingID, secondClient.RegistrationAccessToken, nil) assert.Equal(t, http.StatusUnauthorized, res.StatusCode) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) }) @@ -201,31 +281,50 @@ func TestHandler(t *testing.T) { statusCode: http.StatusBadRequest, }, { - d: "short secret fails", + d: "short secret fails for admin", payload: &client.Client{ OutfacingID: "create-client-4", Secret: "short", RedirectURIs: []string{"http://localhost:3000/cb"}, }, - path: client.DynClientsHandlerPath, + path: client.ClientsHandlerPath, statusCode: http.StatusBadRequest, }, + { + d: "short secret succeeds for selfservice because it is overwritten", + payload: &client.Client{ + OutfacingID: "create-client-4", + Secret: "short", + RedirectURIs: []string{"http://localhost:3000/cb"}, + }, + path: client.DynClientsHandlerPath, + statusCode: http.StatusCreated, + }, } { t.Run(fmt.Sprintf("case=%d/description=%s", k, tc.d), func(t *testing.T) { body, res := makeJSON(t, ts, "POST", tc.path, tc.payload) require.Equal(t, tc.statusCode, res.StatusCode, body) - snapshotx.SnapshotTExcept(t, json.RawMessage(body), []string{"updated_at", "created_at"}) + exclude := []string{"updated_at", "created_at", "registration_access_token"} + if tc.path == client.DynClientsHandlerPath { + exclude = append(exclude, "client_id", "client_secret", "registration_client_uri") + } + if tc.statusCode == http.StatusOK { + for _, key := range exclude { + assert.NotEmpty(t, gjson.Get(body, key).String(), "%s in %s", key, body) + } + } + snapshotx.SnapshotTExcept(t, json.RawMessage(body), exclude) }) } }) t.Run("case=fetching non-existing client", func(t *testing.T) { for _, path := range []string{ - client.DynClientsHandlerPath + "?client_id=foo", + client.DynClientsHandlerPath + "/foo", client.ClientsHandlerPath + "/foo", } { t.Run("path="+path, func(t *testing.T) { - body, res := fetchWithAuth(t, "GET", ts.URL+path, expected.OutfacingID, expected.Secret, nil) + body, res := fetchWithBearerAuth(t, "GET", ts.URL+path, expected.RegistrationAccessToken, nil) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) }) } @@ -233,11 +332,11 @@ func TestHandler(t *testing.T) { t.Run("case=updating non-existing client", func(t *testing.T) { for _, path := range []string{ - client.DynClientsHandlerPath + "?client_id=foo", + client.DynClientsHandlerPath + "/foo", client.ClientsHandlerPath + "/foo", } { t.Run("path="+path, func(t *testing.T) { - body, res := fetchWithAuth(t, "PUT", ts.URL+path, expected.OutfacingID, expected.Secret, bytes.NewBufferString("{}")) + body, res := fetchWithBearerAuth(t, "PUT", ts.URL+path, "invalid", bytes.NewBufferString("{}")) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) }) } @@ -245,50 +344,61 @@ func TestHandler(t *testing.T) { t.Run("case=delete non-existing client", func(t *testing.T) { for _, path := range []string{ - client.DynClientsHandlerPath + "?client_id=foo", + client.DynClientsHandlerPath + "/foo", client.ClientsHandlerPath + "/foo", } { t.Run("path="+path, func(t *testing.T) { - body, res := fetchWithAuth(t, "DELETE", ts.URL+path, expected.OutfacingID, expected.Secret, nil) + body, res := fetchWithBearerAuth(t, "DELETE", ts.URL+path, "invalid", nil) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) }) } }) t.Run("case=patching non-existing client", func(t *testing.T) { - body, res := fetchWithAuth(t, "PATCH", ts.URL+client.ClientsHandlerPath+"/foo", expected.OutfacingID, expected.Secret, nil) + body, res := fetchWithBearerAuth(t, "PATCH", ts.URL+client.ClientsHandlerPath+"/foo", "", nil) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) }) t.Run("case=fetching existing client", func(t *testing.T) { + expected := createClient(t, &client.Client{ + OutfacingID: "existing-client-fetch", + Secret: "rdetzfuzgihojuzgtfrdes", + RedirectURIs: []string{"http://localhost:3000/cb"}, + }, ts, client.ClientsHandlerPath) + id := gjson.Get(expected, "client_id").String() + rat := gjson.Get(expected, "registration_access_token").String() + t.Run("endpoint=admin", func(t *testing.T) { - body, res := fetch(t, ts.URL+client.ClientsHandlerPath+"/"+expected.OutfacingID) + body, res := fetch(t, ts.URL+client.ClientsHandlerPath+"/"+id) assert.Equal(t, http.StatusOK, res.StatusCode) + assert.Equal(t, id, gjson.Get(body, "client_id").String()) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) }) t.Run("endpoint=selfservice", func(t *testing.T) { - body, res := fetchWithAuth(t, "GET", ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, expected.Secret, nil) + body, res := fetchWithBearerAuth(t, "GET", ts.URL+client.DynClientsHandlerPath+"/"+id, rat, nil) assert.Equal(t, http.StatusOK, res.StatusCode) + assert.Equal(t, id, gjson.Get(body, "client_id").String()) + assert.False(t, gjson.Get(body, "metadata").Bool()) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) }) }) - t.Run("case=updating existing client fails with metadat on self service", func(t *testing.T) { + t.Run("case=updating existing client fails with metadata on self service", func(t *testing.T) { expected := &client.Client{ OutfacingID: "update-existing-client-selfservice-metadata", Secret: "averylongsecret", RedirectURIs: []string{"http://localhost:3000/cb"}, TokenEndpointAuthMethod: "client_secret_basic", } - createClient(t, expected, ts, client.ClientsHandlerPath) + body := createClient(t, expected, ts, client.ClientsHandlerPath) // Possible to update the secret expected.Metadata = []byte(`{"foo":"bar"}`) payload, err := json.Marshal(expected) require.NoError(t, err) - body, res := fetchWithAuth(t, "PUT", ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, expected.Secret, bytes.NewReader(payload)) + body, res := fetchWithBearerAuth(t, "PUT", ts.URL+client.DynClientsHandlerPath+"/"+expected.OutfacingID, gjson.Get(body, "registration_access_token").String(), bytes.NewReader(payload)) assert.Equal(t, http.StatusBadRequest, res.StatusCode) snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) }) @@ -309,14 +419,14 @@ func TestHandler(t *testing.T) { snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) }) - t.Run("endpoint=selfservice", func(t *testing.T) { + t.Run("endpoint=dynamic client registration", func(t *testing.T) { expected := &client.Client{ OutfacingID: "update-existing-client-selfservice", Secret: "averylongsecret", RedirectURIs: []string{"http://localhost:3000/cb"}, TokenEndpointAuthMethod: "client_secret_basic", } - createClient(t, expected, ts, client.ClientsHandlerPath) + actual := createClient(t, expected, ts, client.ClientsHandlerPath) // Possible to update the secret expected.Secret = "anothersecret" @@ -324,9 +434,19 @@ func TestHandler(t *testing.T) { payload, err := json.Marshal(expected) require.NoError(t, err) - body, res := fetchWithAuth(t, "PUT", ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, "averylongsecret", bytes.NewReader(payload)) + originalRAT := gjson.Get(actual, "registration_access_token").String() + body, res := fetchWithBearerAuth(t, "PUT", ts.URL+client.DynClientsHandlerPath+"/"+expected.OutfacingID, originalRAT, bytes.NewReader(payload)) assert.Equal(t, http.StatusOK, res.StatusCode) - snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at"}) + newToken := gjson.Get(body, "registration_access_token").String() + assert.NotEmpty(t, newToken) + require.NotEqual(t, originalRAT, newToken, "the new token should be different from the old token") + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), []string{"body.created_at", "body.updated_at", "body.registration_access_token"}) + + _, res = fetchWithBearerAuth(t, "GET", ts.URL+client.DynClientsHandlerPath+"/"+expected.OutfacingID, originalRAT, bytes.NewReader(payload)) + assert.Equal(t, http.StatusUnauthorized, res.StatusCode) + body, res = fetchWithBearerAuth(t, "GET", ts.URL+client.DynClientsHandlerPath+"/"+expected.OutfacingID, newToken, bytes.NewReader(payload)) + assert.Equal(t, http.StatusOK, res.StatusCode) + assert.Empty(t, gjson.Get(body, "registration_access_token").String()) }) }) @@ -352,85 +472,13 @@ func TestHandler(t *testing.T) { RedirectURIs: []string{"http://localhost:3000/cb"}, TokenEndpointAuthMethod: "client_secret_basic", } - body, res := makeJSON(t, ts, "POST", client.ClientsHandlerPath, expected) - require.Equal(t, http.StatusCreated, res.StatusCode, body) + actual, res := makeJSON(t, ts, "POST", client.ClientsHandlerPath, expected) + require.Equal(t, http.StatusCreated, res.StatusCode, actual) - _, res = fetchWithAuth(t, "DELETE", ts.URL+client.DynClientsHandlerPath+"?client_id="+expected.OutfacingID, expected.OutfacingID, "averylongsecret", nil) + originalRAT := gjson.Get(actual, "registration_access_token").String() + _, res = fetchWithBearerAuth(t, "DELETE", ts.URL+client.DynClientsHandlerPath+"/"+expected.OutfacingID, originalRAT, nil) assert.Equal(t, http.StatusNoContent, res.StatusCode) }) }) - - t.Run("case=fetch with different self-service auth methods", func(t *testing.T) { - for k, tc := range []struct { - c *client.Client - r func(t *testing.T, r *http.Request, c *client.Client) - es int - }{ - { - c: &client.Client{ - OutfacingID: "get-client-auth-1", - Secret: "averylongsecret", - RedirectURIs: []string{"http://localhost:3000/cb"}, - TokenEndpointAuthMethod: "client_secret_basic", - }, - r: func(t *testing.T, r *http.Request, c *client.Client) { - r.SetBasicAuth(c.OutfacingID, c.Secret) - }, - es: http.StatusOK, - }, - { - c: &client.Client{ - OutfacingID: "get-client-auth-2", - RedirectURIs: []string{"http://localhost:3000/cb"}, - TokenEndpointAuthMethod: "none", - }, - r: func(t *testing.T, r *http.Request, c *client.Client) { - r.SetBasicAuth(c.OutfacingID, "") - }, - es: http.StatusUnauthorized, - }, - { - c: &client.Client{ - OutfacingID: "get-client-auth-3", - RedirectURIs: []string{"http://localhost:3000/cb"}, - TokenEndpointAuthMethod: "none", - }, - r: func(t *testing.T, r *http.Request, c *client.Client) { - r.SetBasicAuth(c.OutfacingID, "random") - }, - es: http.StatusUnauthorized, - }, - { - c: &client.Client{ - OutfacingID: "get-client-auth-4", - Secret: "averylongsecret", - RedirectURIs: []string{"http://localhost:3000/cb"}, - TokenEndpointAuthMethod: "client_secret_post", - }, - r: func(t *testing.T, r *http.Request, c *client.Client) { - q := r.URL.Query() - q.Set("client_secret", c.Secret) - r.URL.RawQuery = q.Encode() - }, - es: http.StatusOK, - }, - } { - t.Run(fmt.Sprintf("case=%d", k), func(t *testing.T) { - createClient(t, tc.c, ts, client.ClientsHandlerPath) - req, err := http.NewRequest("GET", ts.URL+client.DynClientsHandlerPath+"?client_id="+tc.c.OutfacingID, nil) - require.NoError(t, err) - tc.r(t, req, tc.c) - - res, err := ts.Client().Do(req) - assert.Equal(t, tc.es, res.StatusCode) - require.NoError(t, err) - - body, err := io.ReadAll(res.Body) - require.NoError(t, err) - - snapshotx.SnapshotTExcept(t, newResponseSnapshot(string(body), res), []string{"body.created_at", "body.updated_at"}) - }) - } - }) }) } diff --git a/client/registry.go b/client/registry.go index 5ef7c1df1f1..3daeece84a4 100644 --- a/client/registry.go +++ b/client/registry.go @@ -2,6 +2,8 @@ package client import ( "github.com/ory/fosite" + foauth2 "github.com/ory/fosite/handler/oauth2" + "github.com/ory/hydra/driver/config" "github.com/ory/hydra/jwk" "github.com/ory/hydra/x" ) @@ -16,5 +18,6 @@ type Registry interface { ClientManager() Manager ClientHasher() fosite.Hasher OpenIDJWTStrategy() jwk.JWTStrategy - x.ClientAuthenticatorProvider + OAuth2HMACStrategy() *foauth2.HMACSHAStrategy + Config() *config.Provider } diff --git a/client/sdk_test.go b/client/sdk_test.go index f2ec7f909f7..ec90f69325c 100644 --- a/client/sdk_test.go +++ b/client/sdk_test.go @@ -80,12 +80,13 @@ func TestClientSDK(t *testing.T) { conf := internal.NewConfigurationWithDefaults() conf.MustSet(config.KeySubjectTypesSupported, []string{"public"}) conf.MustSet(config.KeyDefaultClientScope, []string{"foo", "bar"}) + conf.MustSet(config.KeyPublicAllowDynamicRegistration, true) r := internal.NewRegistryMemory(t, conf) routerAdmin := x.NewRouterAdmin() routerPublic := x.NewRouterPublic() handler := client.NewHandler(r) - handler.SetRoutes(routerAdmin, routerPublic, true) + handler.SetRoutes(routerAdmin, routerPublic) server := httptest.NewServer(routerAdmin) c := hydra.NewHTTPClientWithConfig(nil, &hydra.TransportConfig{Schemes: []string{"http"}, Host: urlx.ParseOrPanic(server.URL).Host}) diff --git a/docs/docs/guides/openid-connect-dynamic-client-registration.mdx b/docs/docs/guides/openid-connect-dynamic-client-registration.mdx index bd465b5d98e..43c9a62c0f7 100644 --- a/docs/docs/guides/openid-connect-dynamic-client-registration.mdx +++ b/docs/docs/guides/openid-connect-dynamic-client-registration.mdx @@ -4,9 +4,14 @@ title: OpenID Connect Dynamic Client Registration --- Ory Hydra is capable of exposing -[OpenID Connect Dynamic Client Registration](https://openid.net/specs/openid-connect-registration-1_0.html). -This feature allows anonymous users to create OAuth2 Clients in self-service, -without administrative privileges. + +- [OpenID Connect Dynamic Client Registration](https://openid.net/specs/openid-connect-registration-1_0.html) +- [OAuth 2.0 Dynamic Client Registration Protocol](https://datatracker.ietf.org/doc/html/rfc7591) +- [OAuth 2.0 Dynamic Client Registration Management Protocol](https://datatracker.ietf.org/doc/html/rfc7592) + +endpoints and capabilities. This feature allows third parties to create OAuth2 +Clients in self-service, without administrative privileges. The feature is +disabled by default! This is particularly useful if you are running a public service and want users to be able to create their own OAuth2 clients easily. @@ -23,9 +28,9 @@ Enabling this feature will add listeners to the following four routes at the public endpoint: - `POST /openid/register` - Register a new OAuth2 Client; -- `GET /openid/register?client_id=...` - Fetch the OAuth2 Client; -- `PUT /openid/register?client_id=...` - Update the OAuth2 Client; -- `DELETE /openid/register?client_id=...` - Delete the OAuth2 Client; +- `GET /openid/register/` - Fetch the OAuth2 Client; +- `PUT /openid/register/` - Update the OAuth2 Client; +- `DELETE /openid/register/` - Delete the OAuth2 Client; ## Register OAuth2 & OpenID Connect Clients @@ -38,26 +43,35 @@ Content-Type: application/json { "client_id": "...", + "registration_access_token": "...", ... } ``` -Please note that it is not possible to set OAuth2 Client Metadata using this -endpoint. Metadata is a protected field and can only be set using the +:::note + +The `registration_access_token` will only be sent once! You need to store this +token in a secure location. This token will be used to update the OAuth2 Client. + +::: + +Please note that it is not possible to set OAuth2 Client Metadata, the OAuth2 +Client ID nor the OAuth2 Client Secret using this endpoint. This ensure that +third parties follow the strict security guidlines of the system. + +The metadata field is protected and privileged and can only be set using the administrative endpoint! OAuth2 Client Metadata can also not be read using OpenID Connect Dynamic Client Registration endpoints! ## Manage OAuth2 & OpenID Connect Clients -All endpoints except the `POST` one require the client to authenticate with its -primary credentials. For example, if the OAuth2 Client has -`token_endpoint_auth_method=client_secret_basic` then it will require the client -to authenticate using basic authorization when, for example, updating -information: +The `POST` endpoint requires the client to authenticate with the +`registration_access_token` regardless of the `token_endpoint_auth_method`. It +can be used to update the OAuth2 Client. ``` -PUT /openid/register?client_id=... -Authorization: Basic +PUT /openid/register/{client_id} +Authorization: Bearer Content-Type: application/json { @@ -66,24 +80,32 @@ Content-Type: application/json } ``` -If the OAuth2 Client uses `client_secret_post` as the auth method, you need to -supply the client secret as a query parameter: +The response will include the updated OAuth2 Client. -``` -PUT /openid/register?client_id=...&client_secret=... -Content-Type: application/json +:::note + +When updating the OAuth2 Client, the server will respond with a new registration +access token. The old one will become invalid! +::: + +``` { - "redirect_uris": [...] + "client_id": "...", + "registration_access_token": "..." ... } ``` -If the OAuth2 Client uses `private_key_jwt` as the auth method, you supply the -appropriate assertion as a query parameter as well: +## Get OAuth2 & OpenID Connect Clients + +The `GET` endpoint requires the client to authenticate with the +`registration_access_token` regardless of the `token_endpoint_auth_method`. It +can be used to retrieve the OAuth2 Client. ``` -PUT /openid/register?client_id=...&client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&client_assertion=... +GET /openid/register/{client_id} +Authorization: Bearer Content-Type: application/json { @@ -92,10 +114,13 @@ Content-Type: application/json } ``` -:::info +## Delete OAuth2 & OpenID Connect Clients -It is not possible to manage the OAuth2 Clients with -`token_endpoint_auth_method=none` through the API! These clients can only be -managed using administrative endpoints. +The `DELETE` endpoint requires the client to authenticate with the +`registration_access_token` regardless of the `token_endpoint_auth_method`. It +can be used to delete the OAuth2 Client. -::: +``` +DELETE /openid/register/{client_id} +Authorization: Bearer +``` diff --git a/driver/registry_base.go b/driver/registry_base.go index 65ab12bfb43..a593121c425 100644 --- a/driver/registry_base.go +++ b/driver/registry_base.go @@ -109,7 +109,7 @@ func (m *RegistryBase) RegisterRoutes(admin *x.RouterAdmin, public *x.RouterPubl m.ConsentHandler().SetRoutes(admin) m.KeyHandler().SetRoutes(admin, public, m.OAuth2AwareMiddleware()) - m.ClientHandler().SetRoutes(admin, public, m.C.PublicAllowDynamicRegistration()) + m.ClientHandler().SetRoutes(admin, public) m.OAuth2Handler().SetRoutes(admin, public, m.OAuth2AwareMiddleware()) m.JWTGrantHandler().SetRoutes(admin) } diff --git a/persistence/sql/migrations/20211226156000000000_dynamic_registration.down.sql b/persistence/sql/migrations/20211226156000000000_dynamic_registration.down.sql new file mode 100644 index 00000000000..489f754cdbe --- /dev/null +++ b/persistence/sql/migrations/20211226156000000000_dynamic_registration.down.sql @@ -0,0 +1 @@ +ALTER TABLE hydra_client DROP COLUMN registration_access_token_signature; diff --git a/persistence/sql/migrations/20211226156000000000_dynamic_registration.up.sql b/persistence/sql/migrations/20211226156000000000_dynamic_registration.up.sql new file mode 100644 index 00000000000..69205b82c87 --- /dev/null +++ b/persistence/sql/migrations/20211226156000000000_dynamic_registration.up.sql @@ -0,0 +1 @@ +ALTER TABLE hydra_client ADD COLUMN registration_access_token_signature TEXT NOT NULL DEFAULT ''; From 3842494f59d1f7ad5056e2a6dcc070a06e242d69 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:00:30 +0200 Subject: [PATCH 33/41] u --- client/handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/handler.go b/client/handler.go index 955495684f4..2a58aa1f7ee 100644 --- a/client/handler.go +++ b/client/handler.go @@ -174,7 +174,7 @@ func (h *Handler) CreateClient(r *http.Request, validator func(*Client) error, i c.CreatedAt = time.Now().UTC().Round(time.Second) c.UpdatedAt = c.CreatedAt - token, signature, err := h.r.OAuth2HMACStrategy().GenerateAccessToken(nil, nil) + token, signature, err := h.r.OAuth2HMACStrategy().GenerateAccessToken(r.Context(), nil) if err != nil { return nil, err } @@ -294,7 +294,7 @@ func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Reque } // Regenerate the registration access token - token, signature, err := h.r.OAuth2HMACStrategy().GenerateAccessToken(nil, nil) + token, signature, err := h.r.OAuth2HMACStrategy().GenerateAccessToken(r.Context(), nil) if err != nil { h.r.Writer().WriteError(w, r, err) return From 4cb1512e30c324508696d4fede112dab4e060beb Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:12:25 +0200 Subject: [PATCH 34/41] u --- ...ion=basic_dynamic_client_registration.json | 4 + ...selfservice_because_it_is_overwritten.json | 23 -- ...lly_does_not_allow_setting_the_secret.json | 7 + ...-endpoint=dynamic_client_registration.json | 1 - ...on_does_not_allow_changing_the_secret.json | 7 + ...ler-create_client-case=5-dynamic=true.json | 19 -- ...stration_tokens-case=0-dynamic=false.json} | 0 ...istration_tokens-case=1-dynamic=true.json} | 0 ...stration_tokens-case=2-dynamic=false.json} | 0 ...stration_tokens-case=3-dynamic=false.json} | 0 ...istration_tokens-case=4-dynamic=true.json} | 0 client/handler.go | 14 +- client/handler_test.go | 45 ++- cypress.json | 4 +- .../openid/dynamic_client_registration.js | 159 +++++++--- ...26156000000000_dynamic_registration.up.sql | 2 +- test/e2e/circle-ci.bash | 10 +- test/e2e/docker-compose.yml | 15 +- test/e2e/oauth2-client/src/index.js | 4 +- test/e2e/schema.sql | 274 ++++++++++++++++++ 20 files changed, 473 insertions(+), 115 deletions(-) create mode 100644 client/.snapshots/TestHandler-common-case=create_clients-case=4-description=basic_dynamic_client_registration.json delete mode 100644 client/.snapshots/TestHandler-common-case=create_clients-case=4-description=short_secret_succeeds_for_selfservice_because_it_is_overwritten.json create mode 100644 client/.snapshots/TestHandler-common-case=creating_a_client_dynamically_does_not_allow_setting_the_secret.json create mode 100644 client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration_does_not_allow_changing_the_secret.json delete mode 100644 client/.snapshots/TestHandler-create_client-case=5-dynamic=true.json rename client/.snapshots/{TestHandler-create_client-case=0-dynamic=false.json => TestHandler-create_client_registration_tokens-case=0-dynamic=false.json} (100%) rename client/.snapshots/{TestHandler-create_client-case=1-dynamic=true.json => TestHandler-create_client_registration_tokens-case=1-dynamic=true.json} (100%) rename client/.snapshots/{TestHandler-create_client-case=2-dynamic=false.json => TestHandler-create_client_registration_tokens-case=2-dynamic=false.json} (100%) rename client/.snapshots/{TestHandler-create_client-case=3-dynamic=false.json => TestHandler-create_client_registration_tokens-case=3-dynamic=false.json} (100%) rename client/.snapshots/{TestHandler-create_client-case=4-dynamic=true.json => TestHandler-create_client_registration_tokens-case=4-dynamic=true.json} (100%) create mode 100644 test/e2e/schema.sql diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=4-description=basic_dynamic_client_registration.json b/client/.snapshots/TestHandler-common-case=create_clients-case=4-description=basic_dynamic_client_registration.json new file mode 100644 index 00000000000..ed7884997ef --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=create_clients-case=4-description=basic_dynamic_client_registration.json @@ -0,0 +1,4 @@ +{ + "error": "The requested action was forbidden", + "error_description": "It is not allowed to choose your own OAuth2 Client secret." +} diff --git a/client/.snapshots/TestHandler-common-case=create_clients-case=4-description=short_secret_succeeds_for_selfservice_because_it_is_overwritten.json b/client/.snapshots/TestHandler-common-case=create_clients-case=4-description=short_secret_succeeds_for_selfservice_because_it_is_overwritten.json deleted file mode 100644 index 9b2ef8e0beb..00000000000 --- a/client/.snapshots/TestHandler-common-case=create_clients-case=4-description=short_secret_succeeds_for_selfservice_because_it_is_overwritten.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "client_name": "", - "redirect_uris": [ - "http://localhost:3000/cb" - ], - "grant_types": null, - "response_types": null, - "scope": "offline_access offline openid", - "audience": [], - "owner": "", - "policy_uri": "", - "allowed_cors_origins": [], - "tos_uri": "", - "client_uri": "", - "logo_uri": "", - "contacts": null, - "client_secret_expires_at": 0, - "subject_type": "public", - "jwks": {}, - "token_endpoint_auth_method": "client_secret_basic", - "userinfo_signed_response_alg": "none", - "metadata": {} -} diff --git a/client/.snapshots/TestHandler-common-case=creating_a_client_dynamically_does_not_allow_setting_the_secret.json b/client/.snapshots/TestHandler-common-case=creating_a_client_dynamically_does_not_allow_setting_the_secret.json new file mode 100644 index 00000000000..3fae03ce5b7 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=creating_a_client_dynamically_does_not_allow_setting_the_secret.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The requested action was forbidden", + "error_description": "It is not allowed to choose your own OAuth2 Client secret." + }, + "status": 403 +} diff --git a/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration.json b/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration.json index ff0f1d157c4..c8e9984abfa 100644 --- a/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration.json +++ b/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration.json @@ -2,7 +2,6 @@ "body": { "client_id": "update-existing-client-selfservice", "client_name": "", - "client_secret": "anothersecret", "redirect_uris": [ "http://localhost:3000/cb", "https://foobar.com" diff --git a/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration_does_not_allow_changing_the_secret.json b/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration_does_not_allow_changing_the_secret.json new file mode 100644 index 00000000000..3fae03ce5b7 --- /dev/null +++ b/client/.snapshots/TestHandler-common-case=updating_existing_client-endpoint=dynamic_client_registration_does_not_allow_changing_the_secret.json @@ -0,0 +1,7 @@ +{ + "body": { + "error": "The requested action was forbidden", + "error_description": "It is not allowed to choose your own OAuth2 Client secret." + }, + "status": 403 +} diff --git a/client/.snapshots/TestHandler-create_client-case=5-dynamic=true.json b/client/.snapshots/TestHandler-create_client-case=5-dynamic=true.json deleted file mode 100644 index 8d54b6f7df3..00000000000 --- a/client/.snapshots/TestHandler-create_client-case=5-dynamic=true.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "client_name": "", - "redirect_uris": null, - "grant_types": null, - "response_types": null, - "scope": "", - "audience": [], - "owner": "", - "policy_uri": "", - "allowed_cors_origins": [], - "tos_uri": "", - "client_uri": "", - "logo_uri": "", - "contacts": null, - "client_secret_expires_at": 0, - "subject_type": "", - "jwks": {}, - "metadata": {} -} diff --git a/client/.snapshots/TestHandler-create_client-case=0-dynamic=false.json b/client/.snapshots/TestHandler-create_client_registration_tokens-case=0-dynamic=false.json similarity index 100% rename from client/.snapshots/TestHandler-create_client-case=0-dynamic=false.json rename to client/.snapshots/TestHandler-create_client_registration_tokens-case=0-dynamic=false.json diff --git a/client/.snapshots/TestHandler-create_client-case=1-dynamic=true.json b/client/.snapshots/TestHandler-create_client_registration_tokens-case=1-dynamic=true.json similarity index 100% rename from client/.snapshots/TestHandler-create_client-case=1-dynamic=true.json rename to client/.snapshots/TestHandler-create_client_registration_tokens-case=1-dynamic=true.json diff --git a/client/.snapshots/TestHandler-create_client-case=2-dynamic=false.json b/client/.snapshots/TestHandler-create_client_registration_tokens-case=2-dynamic=false.json similarity index 100% rename from client/.snapshots/TestHandler-create_client-case=2-dynamic=false.json rename to client/.snapshots/TestHandler-create_client_registration_tokens-case=2-dynamic=false.json diff --git a/client/.snapshots/TestHandler-create_client-case=3-dynamic=false.json b/client/.snapshots/TestHandler-create_client_registration_tokens-case=3-dynamic=false.json similarity index 100% rename from client/.snapshots/TestHandler-create_client-case=3-dynamic=false.json rename to client/.snapshots/TestHandler-create_client_registration_tokens-case=3-dynamic=false.json diff --git a/client/.snapshots/TestHandler-create_client-case=4-dynamic=true.json b/client/.snapshots/TestHandler-create_client_registration_tokens-case=4-dynamic=true.json similarity index 100% rename from client/.snapshots/TestHandler-create_client-case=4-dynamic=true.json rename to client/.snapshots/TestHandler-create_client_registration_tokens-case=4-dynamic=true.json diff --git a/client/handler.go b/client/handler.go index 2a58aa1f7ee..3725b3c079d 100644 --- a/client/handler.go +++ b/client/handler.go @@ -155,7 +155,9 @@ func (h *Handler) CreateClient(r *http.Request, validator func(*Client) error, i if isDynamic { c.OutfacingID = uuid.New() - c.Secret = "" + if c.Secret != "" { + return nil, errorsx.WithStack(herodot.ErrForbidden.WithReasonf("It is not allowed to choose your own OAuth2 Client secret.")) + } } if len(c.Secret) == 0 { @@ -293,6 +295,11 @@ func (h *Handler) UpdateDynamicRegistration(w http.ResponseWriter, r *http.Reque return } + if c.Secret != "" { + h.r.Writer().WriteError(w, r, errorsx.WithStack(herodot.ErrForbidden.WithReasonf("It is not allowed to choose your own OAuth2 Client secret."))) + return + } + // Regenerate the registration access token token, signature, err := h.r.OAuth2HMACStrategy().GenerateAccessToken(r.Context(), nil) if err != nil { @@ -606,6 +613,11 @@ func (h *Handler) ValidDynamicAuth(r *http.Request, ps httprouter.Params) (fosit WithReason("The requested OAuth 2.0 client does not exist or you provided incorrect credentials.").WithDebug(err.Error()) } + if len(c.RegistrationAccessTokenSignature) == 0 { + return nil, errors.WithStack(herodot.ErrUnauthorized. + WithReason("The requested OAuth 2.0 client does not exist or you provided incorrect credentials.").WithDebug("The OAuth2 Client does not have a registration access token.")) + } + token := fosite.AccessTokenFromRequest(r) if err := h.r.OAuth2HMACStrategy().Enigma.Validate(token); err != nil { return nil, herodot.ErrUnauthorized. diff --git a/client/handler_test.go b/client/handler_test.go index aa1d778cb92..05782f063d7 100644 --- a/client/handler_test.go +++ b/client/handler_test.go @@ -41,7 +41,7 @@ func TestHandler(t *testing.T) { reg := internal.NewMockedRegistry(t) h := client.NewHandler(reg) - t.Run("create client", func(t *testing.T) { + t.Run("create client registration tokens", func(t *testing.T) { for k, tc := range []struct { c *client.Client dynamic bool @@ -51,7 +51,6 @@ func TestHandler(t *testing.T) { {c: &client.Client{OutfacingID: "create-client-1"}}, {c: &client.Client{Secret: "create-client-2"}}, {c: &client.Client{OutfacingID: "create-client-3"}, dynamic: true}, - {c: &client.Client{Secret: "create-client-4"}, dynamic: true}, } { t.Run(fmt.Sprintf("case=%d/dynamic=%v", k, tc.dynamic), func(t *testing.T) { var b bytes.Buffer @@ -252,7 +251,6 @@ func TestHandler(t *testing.T) { d: "basic dynamic client registration", payload: &client.Client{ OutfacingID: "create-client-1", - Secret: "averylongsecret", RedirectURIs: []string{"http://localhost:3000/cb"}, }, path: client.DynClientsHandlerPath, @@ -273,7 +271,6 @@ func TestHandler(t *testing.T) { d: "metadata fails for dynamic client registration", payload: &client.Client{ OutfacingID: "create-client-3", - Secret: "averylongsecret", RedirectURIs: []string{"http://localhost:3000/cb"}, Metadata: []byte(`{"foo":"bar"}`), }, @@ -291,14 +288,14 @@ func TestHandler(t *testing.T) { statusCode: http.StatusBadRequest, }, { - d: "short secret succeeds for selfservice because it is overwritten", + d: "basic dynamic client registration", payload: &client.Client{ - OutfacingID: "create-client-4", - Secret: "short", + OutfacingID: "create-client-5", + Secret: "averylongsecret", RedirectURIs: []string{"http://localhost:3000/cb"}, }, path: client.DynClientsHandlerPath, - statusCode: http.StatusCreated, + statusCode: http.StatusForbidden, }, } { t.Run(fmt.Sprintf("case=%d/description=%s", k, tc.d), func(t *testing.T) { @@ -395,6 +392,7 @@ func TestHandler(t *testing.T) { // Possible to update the secret expected.Metadata = []byte(`{"foo":"bar"}`) + expected.Secret = "" payload, err := json.Marshal(expected) require.NoError(t, err) @@ -429,8 +427,8 @@ func TestHandler(t *testing.T) { actual := createClient(t, expected, ts, client.ClientsHandlerPath) // Possible to update the secret - expected.Secret = "anothersecret" expected.RedirectURIs = append(expected.RedirectURIs, "https://foobar.com") + expected.Secret = "" payload, err := json.Marshal(expected) require.NoError(t, err) @@ -448,6 +446,35 @@ func TestHandler(t *testing.T) { assert.Equal(t, http.StatusOK, res.StatusCode) assert.Empty(t, gjson.Get(body, "registration_access_token").String()) }) + + t.Run("endpoint=dynamic client registration does not allow changing the secret", func(t *testing.T) { + expected := &client.Client{ + OutfacingID: "update-existing-client-no-secret-change", + RedirectURIs: []string{"http://localhost:3000/cb"}, + TokenEndpointAuthMethod: "client_secret_basic", + } + actual := createClient(t, expected, ts, client.ClientsHandlerPath) + + // Possible to update the secret + expected.Secret = "anothersecret" + expected.RedirectURIs = append(expected.RedirectURIs, "https://foobar.com") + payload, err := json.Marshal(expected) + require.NoError(t, err) + + originalRAT := gjson.Get(actual, "registration_access_token").String() + body, res := fetchWithBearerAuth(t, "PUT", ts.URL+client.DynClientsHandlerPath+"/"+expected.OutfacingID, originalRAT, bytes.NewReader(payload)) + assert.Equal(t, http.StatusForbidden, res.StatusCode) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) + }) + }) + + t.Run("case=creating a client dynamically does not allow setting the secret", func(t *testing.T) { + body, res := makeJSON(t, ts, "POST", client.DynClientsHandlerPath, &client.Client{ + TokenEndpointAuthMethod: "client_secret_basic", + Secret: "foobarbaz", + }) + require.Equal(t, http.StatusForbidden, res.StatusCode, body) + snapshotx.SnapshotTExcept(t, newResponseSnapshot(body, res), nil) }) t.Run("case=delete existing client", func(t *testing.T) { diff --git a/cypress.json b/cypress.json index eccfd50b548..fddaa57d0c9 100644 --- a/cypress.json +++ b/cypress.json @@ -1,10 +1,10 @@ { "env": { - "public_url": "http://127.0.0.1:5000", + "public_url": "http://127.0.0.1:5004", "admin_url": "http://127.0.0.1:5001", "consent_url": "http://127.0.0.1:5002", "client_url": "http://127.0.0.1:5003", - "public_port": "5000", + "public_port": "5004", "client_port": "5003", "jwt_enabled": false }, diff --git a/cypress/integration/openid/dynamic_client_registration.js b/cypress/integration/openid/dynamic_client_registration.js index ff601672948..a219a9bb0d0 100644 --- a/cypress/integration/openid/dynamic_client_registration.js +++ b/cypress/integration/openid/dynamic_client_registration.js @@ -1,100 +1,169 @@ -import { prng } from '../../helpers' - -describe('The Clients Pubic Interface', function () { +describe('OAuth2 / OpenID Connect Dynamic Client Registration', function () { it('should return same client_secret given in request for newly created clients with client_secret specified', function () { cy.request({ method: 'POST', - url: Cypress.env('public_url') + '/connect/register', + url: Cypress.env('public_url') + '/oauth2/register', body: { - client_id: 'clientid', client_name: 'clientName', - client_secret: 'secret', scope: 'foo openid offline_access', grant_types: ['client_credentials'] } }).then((response) => { - expect(response.body.client_secret).to.equal('secret') + expect(response.body.registration_access_token).to.not.be.empty }) }) it('should get client when having a valid client_secret in body', function () { cy.request({ - method: 'GET', - url: Cypress.env('public_url') + '/connect/register?client_id=clientid', - headers: { - Authorization: 'Basic Y2xpZW50aWQ6c2VjcmV0' + method: 'POST', + url: Cypress.env('public_url') + '/oauth2/register', + body: { + client_name: 'clientName', + grant_types: ['client_credentials'] } }).then((response) => { - console.log(response.body) - expect(response.body.client_name).to.equal('clientName') + cy.request({ + method: 'GET', + url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + headers: { + Authorization: 'Bearer ' + response.body.registration_access_token, + } + }).then((response) => { + expect(response.body.client_name).to.equal('clientName') + }) }) }) it('should fail for get client when Authorization header is not presented', function () { cy.request({ - method: 'GET', - failOnStatusCode: false, - url: Cypress.env('public_url') + '/connect/register?client_id=clientid' + method: 'POST', + url: Cypress.env('public_url') + '/oauth2/register', + body: { + grant_types: ['client_credentials'] + } }).then((response) => { - expect(response.status).to.eq(401) + cy.request({ + method: 'GET', + failOnStatusCode: false, + url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + }).then((response) => { + expect(response.status).to.eq(401) + }) }) }) - it('should update client name when having a valid client_secret in body', function () { + it('should update client name', function () { cy.request({ - method: 'PUT', - url: Cypress.env('public_url') + '/connect/register?client_id=clientid', - headers: { - Authorization: 'Basic Y2xpZW50aWQ6c2VjcmV0' - }, + method: 'POST', + url: Cypress.env('public_url') + '/oauth2/register', body: { - client_id: 'clientid', - client_name: 'clientName2', - client_secret: 'secret', - scope: 'foo openid offline_access', grant_types: ['client_credentials'] } }).then((response) => { - expect(response.body.client_name).to.equal('clientName2') + cy.request({ + method: 'PUT', + failOnStatusCode: false, + url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + headers: { + Authorization: 'Bearer ' + response.body.registration_access_token, + }, + body: { + client_id: 'clientid', + client_name: 'clientName2', + scope: 'foo openid offline_access', + grant_types: ['client_credentials'] + } + }).then((response) => { + expect(response.body.client_name).to.equal('clientName2') + expect(response.body.client_id).to.not.equal('clientid') + }) + }) + }) + it('should not be able to choose the secret', function () { + cy.request({ + method: 'POST', + url: Cypress.env('public_url') + '/oauth2/register', + body: { + grant_types: ['client_credentials'] + } + }).then((response) => { + cy.request({ + method: 'PUT', + failOnStatusCode: false, + url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + headers: { + Authorization: 'Bearer ' + response.body.registration_access_token, + }, + body: { + client_id: 'clientid', + client_name: 'clientName2', + client_secret: 'secret', + scope: 'foo openid offline_access', + grant_types: ['client_credentials'] + } + }).then((response) => { + expect(response.status).to.eq(403) + }) }) }) it('should fail to update client name when Authorization header is not presented', function () { cy.request({ - method: 'PUT', - failOnStatusCode: false, - url: Cypress.env('public_url') + '/connect/register?client_id=clientid', + method: 'POST', + url: Cypress.env('public_url') + '/oauth2/register', body: { - client_id: 'clientid', - client_name: 'clientName2', - scope: 'foo openid offline_access', + client_name: 'clientName', grant_types: ['client_credentials'] } }).then((response) => { - expect(response.status).to.eq(401) + cy.request({ + method: 'PUT', + failOnStatusCode: false, + url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id + }).then((response) => { + expect(response.status).to.eq(401) + }) }) }) it('should fail to delete client when Authorization header is not presented', function () { cy.request({ - method: 'DELETE', - failOnStatusCode: false, - url: Cypress.env('public_url') + '/connect/register?client_id=clientid' + method: 'POST', + url: Cypress.env('public_url') + '/oauth2/register', + body: { + client_name: 'clientName', + grant_types: ['client_credentials'] + } }).then((response) => { - expect(response.status).to.eq(401) + cy.request({ + method: 'DELETE', + failOnStatusCode: false, + url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + }).then((response) => { + expect(response.status).to.eq(401) + }) }) }) it('should delete client when having an valid Authorization header', function () { cy.request({ - method: 'DELETE', - failOnStatusCode: false, - url: Cypress.env('public_url') + '/connect/register?client_id=clientid', - headers: { - Authorization: 'Basic Y2xpZW50aWQ6c2VjcmV0' + method: 'POST', + url: Cypress.env('public_url') + '/oauth2/register', + body: { + client_name: 'clientName', + grant_types: ['client_credentials'] } }).then((response) => { - expect(response.status).to.eq(204) + cy.request({ + method: 'DELETE', + failOnStatusCode: false, + url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + headers: { + Authorization: 'Bearer ' + response.body.registration_access_token, + } + }).then((response) => { + expect(response.status).to.eq(204) + }) }) }) }) diff --git a/persistence/sql/migrations/20211226156000000000_dynamic_registration.up.sql b/persistence/sql/migrations/20211226156000000000_dynamic_registration.up.sql index 69205b82c87..bc605c6441a 100644 --- a/persistence/sql/migrations/20211226156000000000_dynamic_registration.up.sql +++ b/persistence/sql/migrations/20211226156000000000_dynamic_registration.up.sql @@ -1 +1 @@ -ALTER TABLE hydra_client ADD COLUMN registration_access_token_signature TEXT NOT NULL DEFAULT ''; +ALTER TABLE hydra_client ADD COLUMN registration_access_token_signature VARCHAR(128) NOT NULL DEFAULT ''; diff --git a/test/e2e/circle-ci.bash b/test/e2e/circle-ci.bash index 2ebd50ceee5..0ed0d2fe7b4 100755 --- a/test/e2e/circle-ci.bash +++ b/test/e2e/circle-ci.bash @@ -15,7 +15,7 @@ killall hydra || true killall node || true # Check if any ports that we need are open already -! nc -zv 127.0.0.1 5000 +! nc -zv 127.0.0.1 5004 ! nc -zv 127.0.0.1 5001 ! nc -zv 127.0.0.1 5002 ! nc -zv 127.0.0.1 5003 @@ -31,12 +31,12 @@ fi if [[ ! -d "./oauth2-client/node_modules/" ]]; then (cd oauth2-client; npm ci) fi -(cd oauth2-client; ADMIN_URL=http://127.0.0.1:5001 PUBLIC_URL=http://127.0.0.1:5000 PORT=5003 npm run start > ../oauth2-client.e2e.log 2>&1 &) +(cd oauth2-client; ADMIN_URL=http://127.0.0.1:5001 PUBLIC_URL=http://127.0.0.1:5004 PORT=5003 npm run start > ../oauth2-client.e2e.log 2>&1 &) # Install consent app (cd oauth2-client; PORT=5002 HYDRA_ADMIN_URL=http://127.0.0.1:5001 npm run consent > ../login-consent-logout.e2e.log 2>&1 &) -export URLS_SELF_ISSUER=http://127.0.0.1:5000 +export URLS_SELF_ISSUER=http://127.0.0.1:5004 export URLS_CONSENT=http://127.0.0.1:5002/consent export URLS_LOGIN=http://127.0.0.1:5002/login export URLS_LOGOUT=http://127.0.0.1:5002/logout @@ -50,7 +50,7 @@ export SERVE_ADMIN_CORS_ALLOWED_METHODS=POST,GET,PUT,DELETE export LOG_LEVEL=trace export LOG_FORMAT=json export OAUTH2_EXPOSE_INTERNAL_ERRORS=1 -export SERVE_PUBLIC_PORT=5000 +export SERVE_PUBLIC_PORT=5004 export SERVE_ADMIN_PORT=5001 export LOG_LEAK_SENSITIVE_VALUES=true @@ -97,7 +97,7 @@ done npm run wait-on -- -l -t 300000 \ --interval 1000 -s 1 -d 1000 \ - http-get://localhost:5000/health/ready http-get://localhost:5001/health/ready http-get://localhost:5002/ http-get://localhost:5003/oauth2/callback + http-get://localhost:5004/health/ready http-get://localhost:5001/health/ready http-get://localhost:5002/ http-get://localhost:5003/oauth2/callback if [[ $WATCH = "yes" ]]; then (cd ../..; npm run test:watch) diff --git a/test/e2e/docker-compose.yml b/test/e2e/docker-compose.yml index b3062620ed8..99ae16a4e16 100644 --- a/test/e2e/docker-compose.yml +++ b/test/e2e/docker-compose.yml @@ -7,15 +7,15 @@ services: - jaeger image: oryd/hydra:e2e ports: - - "5000:4444" # Public port + - "5004:4444" # Public port - "5001:4445" # Admin port command: serve all --dangerous-force-http environment: - - URLS_SELF_ISSUER=http://127.0.0.1:5000 - - URLS_CONSENT=http://127.0.0.1:5002/consent - - URLS_LOGIN=http://127.0.0.1:5002/login - - URLS_LOGOUT=http://127.0.0.1:5002/logout + - URLS_SELF_ISSUER=http://127_0_0_1:5004 + - URLS_CONSENT=http://127_0_0_1:5002/consent + - URLS_LOGIN=http://127_0_0_1:5002/login + - URLS_LOGOUT=http://127_0_0_1:5002/logout - DSN=memory - SECRETS_SYSTEM=youReallyNeedToChangeThis - OIDC_SUBJECT_IDENTIFIERS_SUPPORTED_TYPES=public,pairwise @@ -32,6 +32,7 @@ services: - TRACING_PROVIDER_JAEGER_SAMPLING_TYPE=const - TRACING_PROVIDER_JAEGER_SAMPLING_VALUE=1 - WEBFINGER_OIDC_DISCOVERY_USERINFO_URL=http://hydra:4444/userinfo + - OIDC_DYNAMIC_CLIENT_REGISTRATION_ENABLED=true restart: unless-stopped consent: @@ -48,12 +49,12 @@ services: - PUBLIC_URL=http://hydra:4444 - PORT=5003 build: - context: ./oauth2-client + context: _/oauth2-client ports: - "5003:5003" restart: unless-stopped jaeger: - image: jaegertracing/all-in-one:1.7.0 + image: jaegertracing/all-in-one:1_7_0 ports: - "9411:9411" diff --git a/test/e2e/oauth2-client/src/index.js b/test/e2e/oauth2-client/src/index.js index 46e017c78a5..7ad3ac6b055 100644 --- a/test/e2e/oauth2-client/src/index.js +++ b/test/e2e/oauth2-client/src/index.js @@ -25,8 +25,8 @@ const isStatusOk = (res) => ) const config = { - url: process.env.AUTHORIZATION_SERVER_URL || 'http://127.0.0.1:5000/', - public: process.env.PUBLIC_URL || 'http://127.0.0.1:5000/', + url: process.env.AUTHORIZATION_SERVER_URL || 'http://127.0.0.1:5004/', + public: process.env.PUBLIC_URL || 'http://127.0.0.1:5004/', admin: process.env.ADMIN_URL || 'http://127.0.0.1:5001/', port: parseInt(process.env.PORT) || 5003 } diff --git a/test/e2e/schema.sql b/test/e2e/schema.sql new file mode 100644 index 00000000000..67671df0873 --- /dev/null +++ b/test/e2e/schema.sql @@ -0,0 +1,274 @@ +CREATE TABLE schema_migration (version VARCHAR (48) NOT NULL, version_self INT NOT NULL DEFAULT 0); +CREATE UNIQUE INDEX schema_migration_version_idx ON schema_migration (version); +CREATE INDEX schema_migration_version_self_idx ON schema_migration (version_self); +CREATE TABLE hydra_client +( + id VARCHAR(255) NOT NULL, + client_name TEXT NOT NULL, + client_secret TEXT NOT NULL, + redirect_uris TEXT NOT NULL, + grant_types TEXT NOT NULL, + response_types TEXT NOT NULL, + scope TEXT NOT NULL, + owner TEXT NOT NULL, + policy_uri TEXT NOT NULL, + tos_uri TEXT NOT NULL, + client_uri TEXT NOT NULL, + logo_uri TEXT NOT NULL, + contacts TEXT NOT NULL, + client_secret_expires_at INTEGER NOT NULL DEFAULT 0, + sector_identifier_uri TEXT NOT NULL, + jwks TEXT NOT NULL, + jwks_uri TEXT NOT NULL, + request_uris TEXT NOT NULL, + token_endpoint_auth_method VARCHAR(25) NOT NULL DEFAULT '', + request_object_signing_alg VARCHAR(10) NOT NULL DEFAULT '', + userinfo_signed_response_alg VARCHAR(10) NOT NULL DEFAULT '', + subject_type VARCHAR(15) NOT NULL DEFAULT '', + allowed_cors_origins TEXT NOT NULL, + pk INTEGER PRIMARY KEY, + audience TEXT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + frontchannel_logout_uri TEXT NOT NULL DEFAULT '', + frontchannel_logout_session_required INTEGER NOT NULL DEFAULT false, + post_logout_redirect_uris TEXT NOT NULL DEFAULT '', + backchannel_logout_uri TEXT NOT NULL DEFAULT '', + backchannel_logout_session_required INTEGER NOT NULL DEFAULT false, + metadata TEXT NOT NULL DEFAULT '{}', + token_endpoint_auth_signing_alg VARCHAR(10) NOT NULL DEFAULT '' +, registration_access_token_signature VARCHAR(128) NOT NULL DEFAULT ''); +CREATE UNIQUE INDEX hydra_client_id_idx ON hydra_client (id); +CREATE TABLE hydra_jwk +( + sid VARCHAR(255) NOT NULL, + kid VARCHAR(255) NOT NULL, + version INTEGER NOT NULL DEFAULT 0, + keydata TEXT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + pk INTEGER PRIMARY KEY +); +CREATE UNIQUE INDEX hydra_jwk_sid_kid_key ON hydra_jwk (sid, kid); +CREATE TABLE hydra_oauth2_authentication_request +( + challenge VARCHAR(40) NOT NULL PRIMARY KEY, + requested_scope TEXT NOT NULL, + verifier VARCHAR(40) NOT NULL, + csrf VARCHAR(40) NOT NULL, + subject VARCHAR(255) NOT NULL, + request_url TEXT NOT NULL, + skip INTEGER NOT NULL, + client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, + requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + authenticated_at TIMESTAMP NULL, + oidc_context TEXT NOT NULL, + login_session_id VARCHAR(40) NULL REFERENCES hydra_oauth2_authentication_session (id) ON DELETE CASCADE DEFAULT '', + requested_at_audience TEXT NULL DEFAULT '' +); +CREATE INDEX hydra_oauth2_authentication_request_client_id_idx ON hydra_oauth2_authentication_request (client_id); +CREATE INDEX hydra_oauth2_authentication_request_login_session_id_idx ON hydra_oauth2_authentication_request (login_session_id); +CREATE INDEX hydra_oauth2_authentication_request_subject_idx ON hydra_oauth2_authentication_request (subject); +CREATE UNIQUE INDEX hydra_oauth2_authentication_request_verifier_idx ON hydra_oauth2_authentication_request (verifier); +CREATE TABLE hydra_oauth2_consent_request +( + challenge VARCHAR(40) NOT NULL PRIMARY KEY, + verifier VARCHAR(40) NOT NULL, + client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, + subject VARCHAR(255) NOT NULL, + request_url TEXT NOT NULL, + skip INTEGER NOT NULL, + requested_scope TEXT NOT NULL, + csrf VARCHAR(40) NOT NULL, + authenticated_at TIMESTAMP NULL, + requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + oidc_context TEXT NOT NULL, + forced_subject_identifier VARCHAR(255) NULL DEFAULT '', + login_session_id VARCHAR(40) NULL REFERENCES hydra_oauth2_authentication_session (id) ON DELETE SET NULL, + login_challenge VARCHAR(40) NULL REFERENCES hydra_oauth2_authentication_request (challenge) ON DELETE SET NULL, + requested_at_audience TEXT NULL DEFAULT '', + acr TEXT NULL DEFAULT '', + context TEXT NOT NULL DEFAULT '{}' +, amr TEXT NOT NULL DEFAULT ''); +CREATE INDEX hydra_oauth2_consent_request_client_id_idx ON hydra_oauth2_consent_request (client_id); +CREATE INDEX hydra_oauth2_consent_request_subject_idx ON hydra_oauth2_consent_request (subject); +CREATE INDEX hydra_oauth2_consent_request_login_session_id_idx ON hydra_oauth2_consent_request (login_session_id); +CREATE INDEX hydra_oauth2_consent_request_login_challenge_idx ON hydra_oauth2_consent_request (login_challenge); +CREATE TABLE hydra_oauth2_consent_request_handled +( + challenge VARCHAR(40) NOT NULL PRIMARY KEY REFERENCES hydra_oauth2_consent_request (challenge) ON DELETE CASCADE, + granted_scope TEXT NOT NULL, + remember INTEGER NOT NULL, + remember_for INTEGER NOT NULL, + error TEXT NOT NULL, + requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + session_access_token TEXT NOT NULL, + session_id_token TEXT NOT NULL, + authenticated_at TIMESTAMP NULL, + was_used INTEGER NOT NULL, + granted_at_audience TEXT NULL DEFAULT '', + handled_at TIMESTAMP NULL +); +CREATE TABLE hydra_oauth2_authentication_request_handled +( + challenge VARCHAR(40) NOT NULL PRIMARY KEY REFERENCES hydra_oauth2_authentication_request (challenge) ON DELETE CASCADE, + subject VARCHAR(255) NOT NULL, + remember INTEGER NOT NULL, + remember_for INTEGER NOT NULL, + error TEXT NOT NULL, + acr TEXT NOT NULL, + requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + authenticated_at TIMESTAMP NULL, + was_used INTEGER NOT NULL, + forced_subject_identifier VARCHAR(255) NULL DEFAULT '', + context TEXT NOT NULL DEFAULT '{}' +, amr TEXT NOT NULL DEFAULT ''); +CREATE TABLE hydra_oauth2_code +( + signature VARCHAR(255) NOT NULL, + request_id VARCHAR(40) NOT NULL, + requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, + scope TEXT NOT NULL, + granted_scope TEXT NOT NULL, + form_data TEXT NOT NULL, + session_data TEXT NOT NULL, + subject VARCHAR(255) NOT NULL DEFAULT '', + active INTEGER NOT NULL DEFAULT true, + requested_audience TEXT NULL DEFAULT '', + granted_audience TEXT NULL DEFAULT '', + challenge_id VARCHAR(40) NULL REFERENCES hydra_oauth2_consent_request_handled (challenge) ON DELETE CASCADE +); +CREATE INDEX hydra_oauth2_code_client_id_idx ON hydra_oauth2_code (client_id); +CREATE INDEX hydra_oauth2_code_challenge_id_idx ON hydra_oauth2_code (challenge_id); +CREATE TABLE hydra_oauth2_jti_blacklist +( + signature VARCHAR(64) NOT NULL PRIMARY KEY, + expires_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); +CREATE INDEX hydra_oauth2_jti_blacklist_expires_at_idx ON hydra_oauth2_jti_blacklist (expires_at); +CREATE TABLE hydra_oauth2_logout_request +( + challenge VARCHAR(36) NOT NULL PRIMARY KEY, + verifier VARCHAR(36) NOT NULL, + subject VARCHAR(255) NOT NULL, + sid VARCHAR(36) NOT NULL, + client_id VARCHAR(255) NULL REFERENCES hydra_client (id) ON DELETE CASCADE, + request_url TEXT NOT NULL, + redir_url TEXT NOT NULL, + was_used INTEGER NOT NULL DEFAULT false, + accepted INTEGER NOT NULL DEFAULT false, + rejected INTEGER NOT NULL DEFAULT false, + rp_initiated INTEGER NOT NULL DEFAULT false, + UNIQUE (verifier) +); +CREATE INDEX hydra_oauth2_logout_request_client_id_idx ON hydra_oauth2_logout_request (client_id); +CREATE TABLE hydra_oauth2_obfuscated_authentication_session +( + subject VARCHAR(255) NOT NULL, + client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, + subject_obfuscated VARCHAR(255) NOT NULL, + PRIMARY KEY (subject, client_id) +); +CREATE INDEX hydra_oauth2_obfuscated_authentication_session_client_id_subject_obfuscated_idx ON hydra_oauth2_obfuscated_authentication_session (client_id, subject_obfuscated); +CREATE TABLE hydra_oauth2_oidc +( + signature VARCHAR(255) NOT NULL PRIMARY KEY, + request_id VARCHAR(40) NOT NULL, + requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, + scope TEXT NOT NULL, + granted_scope TEXT NOT NULL, + form_data TEXT NOT NULL, + session_data TEXT NOT NULL, + subject VARCHAR(255) NOT NULL DEFAULT '', + active INTEGER NOT NULL DEFAULT true, + requested_audience TEXT NULL DEFAULT '', + granted_audience TEXT NULL DEFAULT '', + challenge_id VARCHAR(40) NULL REFERENCES hydra_oauth2_consent_request_handled (challenge) ON DELETE CASCADE +); +CREATE INDEX hydra_oauth2_oidc_client_id_idx ON hydra_oauth2_oidc (client_id); +CREATE INDEX hydra_oauth2_oidc_challenge_id_idx ON hydra_oauth2_oidc (challenge_id); +CREATE TABLE hydra_oauth2_pkce +( + signature VARCHAR(255) NOT NULL PRIMARY KEY, + request_id VARCHAR(40) NOT NULL, + requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, + scope TEXT NOT NULL, + granted_scope TEXT NOT NULL, + form_data TEXT NOT NULL, + session_data TEXT NOT NULL, + subject VARCHAR(255) NOT NULL, + active INTEGER NOT NULL DEFAULT true, + requested_audience TEXT NULL DEFAULT '', + granted_audience TEXT NULL DEFAULT '', + challenge_id VARCHAR(40) NULL REFERENCES hydra_oauth2_consent_request_handled (challenge) ON DELETE CASCADE +); +CREATE INDEX hydra_oauth2_pkce_client_id_idx ON hydra_oauth2_pkce (client_id); +CREATE INDEX hydra_oauth2_pkce_challenge_id_idx ON hydra_oauth2_pkce (challenge_id); +CREATE TABLE IF NOT EXISTS "hydra_oauth2_access" +( + signature VARCHAR(255) NOT NULL PRIMARY KEY, + request_id VARCHAR(40) NOT NULL, + requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, + scope TEXT NOT NULL, + granted_scope TEXT NOT NULL, + form_data TEXT NOT NULL, + session_data TEXT NOT NULL, + subject VARCHAR(255) NOT NULL DEFAULT '', + active INTEGER NOT NULL DEFAULT true, + requested_audience TEXT NULL DEFAULT '', + granted_audience TEXT NULL DEFAULT '', + challenge_id VARCHAR(40) NULL REFERENCES hydra_oauth2_consent_request_handled (challenge) ON DELETE CASCADE +); +CREATE INDEX hydra_oauth2_access_requested_at_idx ON hydra_oauth2_access (requested_at); +CREATE INDEX hydra_oauth2_access_client_id_idx ON hydra_oauth2_access (client_id); +CREATE INDEX hydra_oauth2_access_challenge_id_idx ON hydra_oauth2_access (challenge_id); +CREATE INDEX hydra_oauth2_access_client_id_subject_idx ON hydra_oauth2_access (client_id, subject); +CREATE TABLE IF NOT EXISTS "hydra_oauth2_refresh" +( + signature VARCHAR(255) NOT NULL PRIMARY KEY, + request_id VARCHAR(40) NOT NULL, + requested_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + client_id VARCHAR(255) NOT NULL REFERENCES hydra_client (id) ON DELETE CASCADE, + scope TEXT NOT NULL, + granted_scope TEXT NOT NULL, + form_data TEXT NOT NULL, + session_data TEXT NOT NULL, + subject VARCHAR(255) NOT NULL DEFAULT '', + active INTEGER NOT NULL DEFAULT true, + requested_audience TEXT NULL DEFAULT '', + granted_audience TEXT NULL DEFAULT '', + challenge_id VARCHAR(40) NULL REFERENCES hydra_oauth2_consent_request_handled (challenge) ON DELETE CASCADE +); +CREATE INDEX hydra_oauth2_refresh_client_id_idx ON hydra_oauth2_refresh (client_id); +CREATE INDEX hydra_oauth2_refresh_challenge_id_idx ON hydra_oauth2_refresh (challenge_id); +CREATE INDEX hydra_oauth2_refresh_client_id_subject_idx ON hydra_oauth2_refresh (client_id, subject); +CREATE INDEX hydra_oauth2_access_request_id_idx ON hydra_oauth2_access (request_id); +CREATE INDEX hydra_oauth2_refresh_request_id_idx ON hydra_oauth2_refresh (request_id); +CREATE INDEX hydra_oauth2_code_request_id_idx ON hydra_oauth2_code (request_id); +CREATE INDEX hydra_oauth2_oidc_request_id_idx ON hydra_oauth2_oidc (request_id); +CREATE INDEX hydra_oauth2_pkce_request_id_idx ON hydra_oauth2_pkce (request_id); +CREATE TABLE IF NOT EXISTS "hydra_oauth2_authentication_session" +( + id VARCHAR(40) NOT NULL PRIMARY KEY, + authenticated_at TIMESTAMP NULL, + subject VARCHAR(255) NOT NULL, + remember INTEGER NOT NULL DEFAULT false +); +CREATE INDEX hydra_oauth2_authentication_session_subject_idx ON hydra_oauth2_authentication_session (subject); +CREATE TABLE hydra_oauth2_trusted_jwt_bearer_issuer +( + id VARCHAR(36) PRIMARY KEY, + issuer VARCHAR(255) NOT NULL, + subject VARCHAR(255) NOT NULL, + scope TEXT NOT NULL, + key_set varchar(255) NOT NULL, + key_id varchar(255) NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + expires_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + UNIQUE (issuer, subject, key_id), + FOREIGN KEY (key_set, key_id) REFERENCES hydra_jwk (sid, kid) ON DELETE CASCADE +); +CREATE INDEX hydra_oauth2_trusted_jwt_bearer_issuer_expires_at_idx ON hydra_oauth2_trusted_jwt_bearer_issuer (expires_at); From 6ade9633903d1de6b400d90359b3700a9516a7a0 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:12:41 +0200 Subject: [PATCH 35/41] u --- .../openid/dynamic_client_registration.js | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/cypress/integration/openid/dynamic_client_registration.js b/cypress/integration/openid/dynamic_client_registration.js index a219a9bb0d0..d6d9eb79031 100644 --- a/cypress/integration/openid/dynamic_client_registration.js +++ b/cypress/integration/openid/dynamic_client_registration.js @@ -24,9 +24,12 @@ describe('OAuth2 / OpenID Connect Dynamic Client Registration', function () { }).then((response) => { cy.request({ method: 'GET', - url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + url: + Cypress.env('public_url') + + '/oauth2/register/' + + response.body.client_id, headers: { - Authorization: 'Bearer ' + response.body.registration_access_token, + Authorization: 'Bearer ' + response.body.registration_access_token } }).then((response) => { expect(response.body.client_name).to.equal('clientName') @@ -45,7 +48,10 @@ describe('OAuth2 / OpenID Connect Dynamic Client Registration', function () { cy.request({ method: 'GET', failOnStatusCode: false, - url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + url: + Cypress.env('public_url') + + '/oauth2/register/' + + response.body.client_id }).then((response) => { expect(response.status).to.eq(401) }) @@ -63,9 +69,12 @@ describe('OAuth2 / OpenID Connect Dynamic Client Registration', function () { cy.request({ method: 'PUT', failOnStatusCode: false, - url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + url: + Cypress.env('public_url') + + '/oauth2/register/' + + response.body.client_id, headers: { - Authorization: 'Bearer ' + response.body.registration_access_token, + Authorization: 'Bearer ' + response.body.registration_access_token }, body: { client_id: 'clientid', @@ -90,9 +99,12 @@ describe('OAuth2 / OpenID Connect Dynamic Client Registration', function () { cy.request({ method: 'PUT', failOnStatusCode: false, - url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + url: + Cypress.env('public_url') + + '/oauth2/register/' + + response.body.client_id, headers: { - Authorization: 'Bearer ' + response.body.registration_access_token, + Authorization: 'Bearer ' + response.body.registration_access_token }, body: { client_id: 'clientid', @@ -119,7 +131,10 @@ describe('OAuth2 / OpenID Connect Dynamic Client Registration', function () { cy.request({ method: 'PUT', failOnStatusCode: false, - url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id + url: + Cypress.env('public_url') + + '/oauth2/register/' + + response.body.client_id }).then((response) => { expect(response.status).to.eq(401) }) @@ -138,7 +153,10 @@ describe('OAuth2 / OpenID Connect Dynamic Client Registration', function () { cy.request({ method: 'DELETE', failOnStatusCode: false, - url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + url: + Cypress.env('public_url') + + '/oauth2/register/' + + response.body.client_id }).then((response) => { expect(response.status).to.eq(401) }) @@ -157,9 +175,12 @@ describe('OAuth2 / OpenID Connect Dynamic Client Registration', function () { cy.request({ method: 'DELETE', failOnStatusCode: false, - url: Cypress.env('public_url') + '/oauth2/register/' + response.body.client_id, + url: + Cypress.env('public_url') + + '/oauth2/register/' + + response.body.client_id, headers: { - Authorization: 'Bearer ' + response.body.registration_access_token, + Authorization: 'Bearer ' + response.body.registration_access_token } }).then((response) => { expect(response.status).to.eq(204) From db9537fc3e66ed13b999e78f1d8d45cc20a00822 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:40:40 +0200 Subject: [PATCH 36/41] u --- client/doc.go | 28 +- .../httpclient/client/public/public_client.go | 335 +++++++++--------- ...ervice_create_o_auth2_client_parameters.go | 135 ------- ...service_create_o_auth2_client_responses.go | 117 ------ ...ervice_delete_o_auth2_client_parameters.go | 136 ------- ...service_delete_o_auth2_client_responses.go | 106 ------ ...f_service_get_o_auth2_client_parameters.go | 112 ------ ...lf_service_get_o_auth2_client_responses.go | 117 ------ ...ervice_update_o_auth2_client_parameters.go | 157 -------- ...service_update_o_auth2_client_responses.go | 117 ------ internal/httpclient/models/o_auth2_client.go | 6 + spec/api.json | 76 ++-- 12 files changed, 236 insertions(+), 1206 deletions(-) delete mode 100644 internal/httpclient/client/public/self_service_create_o_auth2_client_parameters.go delete mode 100644 internal/httpclient/client/public/self_service_create_o_auth2_client_responses.go delete mode 100644 internal/httpclient/client/public/self_service_delete_o_auth2_client_parameters.go delete mode 100644 internal/httpclient/client/public/self_service_delete_o_auth2_client_responses.go delete mode 100644 internal/httpclient/client/public/self_service_get_o_auth2_client_parameters.go delete mode 100644 internal/httpclient/client/public/self_service_get_o_auth2_client_responses.go delete mode 100644 internal/httpclient/client/public/self_service_update_o_auth2_client_parameters.go delete mode 100644 internal/httpclient/client/public/self_service_update_o_auth2_client_responses.go diff --git a/client/doc.go b/client/doc.go index 0fd37bf7acc..fa68f7f3ef8 100644 --- a/client/doc.go +++ b/client/doc.go @@ -29,8 +29,8 @@ package client -// swagger:parameters createOAuth2Client selfServiceCreateOAuth2Client -type swaggerCreateClientPayload struct { +// swagger:parameters createOAuth2Client dynamicClientRegistrationCreateOAuth2Client +type dynamicClientRegistrationCreateOAuth2Client struct { // in: body // required: true Body Client @@ -47,11 +47,11 @@ type swaggerUpdateClientPayload struct { Body Client } -// swagger:parameters selfServiceUpdateOAuth2Client -type swaggerUpdateDynClientPayload struct { - // in: query +// swagger:parameters dynamicClientRegistrationUpdateOAuth2Client +type dynamicClientRegistrationUpdateOAuth2Client struct { + // in: path // required: true - ID string `json:"client_id"` + ID string `json:"id"` // in: body // required: true @@ -113,11 +113,11 @@ type swaggerGetOAuth2Client struct { ID string `json:"id"` } -// swagger:parameters getDynOAuth2Client -type swaggerGetDynOAuth2Client struct { - // in: query +// swagger:parameters dynamicClientRegistrationGetOAuth2Client +type dynamicClientRegistrationGetOAuth2Client struct { + // in: path // required: true - ID string `json:"client_id"` + ID string `json:"id"` } // swagger:parameters deleteOAuth2Client @@ -128,9 +128,9 @@ type swaggerDeleteOAuth2Client struct { ID string `json:"id"` } -// swagger:parameters selfServiceDeleteOAuth2Client -type swaggerDeleteDynOAuth2Client struct { - // in: query +// swagger:parameters dynamicClientRegistrationDeleteOAuth2Client +type dynamicClientRegistrationDeleteOAuth2Client struct { + // in: path // required: true - ID string `json:"client_id"` + ID string `json:"id"` } diff --git a/internal/httpclient/client/public/public_client.go b/internal/httpclient/client/public/public_client.go index d345aa70eab..0e139c9c431 100644 --- a/internal/httpclient/client/public/public_client.go +++ b/internal/httpclient/client/public/public_client.go @@ -31,21 +31,21 @@ type ClientService interface { DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams) (*DiscoverOpenIDConfigurationOK, error) - IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceReadyOK, error) + DynamicClientRegistrationCreateOAuth2Client(params *DynamicClientRegistrationCreateOAuth2ClientParams) (*DynamicClientRegistrationCreateOAuth2ClientCreated, error) - Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*Oauth2TokenOK, error) + DynamicClientRegistrationDeleteOAuth2Client(params *DynamicClientRegistrationDeleteOAuth2ClientParams) (*DynamicClientRegistrationDeleteOAuth2ClientNoContent, error) - OauthAuth(params *OauthAuthParams) error + DynamicClientRegistrationGetOAuth2Client(params *DynamicClientRegistrationGetOAuth2ClientParams) (*DynamicClientRegistrationGetOAuth2ClientOK, error) - RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeOAuth2TokenOK, error) + DynamicClientRegistrationUpdateOAuth2Client(params *DynamicClientRegistrationUpdateOAuth2ClientParams) (*DynamicClientRegistrationUpdateOAuth2ClientOK, error) - SelfServiceCreateOAuth2Client(params *SelfServiceCreateOAuth2ClientParams) (*SelfServiceCreateOAuth2ClientCreated, error) + IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceReadyOK, error) - SelfServiceDeleteOAuth2Client(params *SelfServiceDeleteOAuth2ClientParams) (*SelfServiceDeleteOAuth2ClientNoContent, error) + Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*Oauth2TokenOK, error) - SelfServiceGetOAuth2Client(params *SelfServiceGetOAuth2ClientParams) (*SelfServiceGetOAuth2ClientOK, error) + OauthAuth(params *OauthAuthParams) error - SelfServiceUpdateOAuth2Client(params *SelfServiceUpdateOAuth2ClientParams) (*SelfServiceUpdateOAuth2ClientOK, error) + RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeOAuth2TokenOK, error) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter) (*UserinfoOK, error) @@ -128,342 +128,345 @@ func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfiguration } /* - IsInstanceReady checks readiness status + DynamicClientRegistrationCreateOAuth2Client registers an o auth 2 0 client using the open ID o auth2 dynamic client registration management protocol - This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. -the database) are responsive as well. + This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the +public internet directly and can be used in self-service. It implements the OpenID Connect +Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +is disabled by default. It can be enabled by an administrator. -If the service supports TLS Edge Termination, this endpoint does not require the -`X-Forwarded-Proto` header to be set. +Please note that using this endpoint you are not able to choose the `client_secret` nor the `client_id` as those +values will be server generated when specifying `token_endpoint_auth_method` as `client_secret_basic` or +`client_secret_post`. -Be aware that if you are running multiple nodes of this service, the health status will never -refer to the cluster state, only to a single instance. +The `client_secret` will be returned in the response and you will not be able to retrieve it later on. +Write the secret down and keep it somewhere safe. */ -func (a *Client) IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceReadyOK, error) { +func (a *Client) DynamicClientRegistrationCreateOAuth2Client(params *DynamicClientRegistrationCreateOAuth2ClientParams) (*DynamicClientRegistrationCreateOAuth2ClientCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewIsInstanceReadyParams() + params = NewDynamicClientRegistrationCreateOAuth2ClientParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "isInstanceReady", - Method: "GET", - PathPattern: "/health/ready", + ID: "dynamicClientRegistrationCreateOAuth2Client", + Method: "POST", + PathPattern: "/connect/register", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, + ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &IsInstanceReadyReader{formats: a.formats}, + Reader: &DynamicClientRegistrationCreateOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, }) if err != nil { return nil, err } - success, ok := result.(*IsInstanceReadyOK) + success, ok := result.(*DynamicClientRegistrationCreateOAuth2ClientCreated) if ok { return success, nil } // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for isInstanceReady: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + unexpectedSuccess := result.(*DynamicClientRegistrationCreateOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } /* - Oauth2Token thes o auth 2 0 token endpoint + DynamicClientRegistrationDeleteOAuth2Client deletes an o auth 2 0 client using the open ID o auth2 dynamic client registration management protocol - The client makes a request to the token endpoint by sending the -following parameters using the "application/x-www-form-urlencoded" HTTP -request entity-body. + This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of facing the +public internet directly and can be used in self-service. It implements the OpenID Connect +Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +is disabled by default. It can be enabled by an administrator. -> Do not implement a client for this endpoint yourself. Use a library. There are many libraries -> available for any programming language. You can find a list of libraries here: https://oauth.net/code/ -> -> Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed above! +To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client +uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. +If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. */ -func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*Oauth2TokenOK, error) { +func (a *Client) DynamicClientRegistrationDeleteOAuth2Client(params *DynamicClientRegistrationDeleteOAuth2ClientParams) (*DynamicClientRegistrationDeleteOAuth2ClientNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewOauth2TokenParams() + params = NewDynamicClientRegistrationDeleteOAuth2ClientParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "oauth2Token", - Method: "POST", - PathPattern: "/oauth2/token", + ID: "dynamicClientRegistrationDeleteOAuth2Client", + Method: "DELETE", + PathPattern: "/connect/register/{id}", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &Oauth2TokenReader{formats: a.formats}, - AuthInfo: authInfo, + Reader: &DynamicClientRegistrationDeleteOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, }) if err != nil { return nil, err } - success, ok := result.(*Oauth2TokenOK) + success, ok := result.(*DynamicClientRegistrationDeleteOAuth2ClientNoContent) if ok { return success, nil } // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for oauth2Token: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + unexpectedSuccess := result.(*DynamicClientRegistrationDeleteOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } /* - OauthAuth thes o auth 2 0 authorize endpoint + DynamicClientRegistrationGetOAuth2Client gets an o auth 2 0 client using the open ID o auth2 dynamic client registration management protocol - This endpoint is not documented here because you should never use your own implementation to perform OAuth2 flows. -OAuth2 is a very popular protocol and a library for your programming language will exists. + This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the +public internet directly and can be used in self-service. It implements the OpenID Connect +Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +is disabled by default. It can be enabled by an administrator. -To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749 +To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client +uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. +If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. */ -func (a *Client) OauthAuth(params *OauthAuthParams) error { +func (a *Client) DynamicClientRegistrationGetOAuth2Client(params *DynamicClientRegistrationGetOAuth2ClientParams) (*DynamicClientRegistrationGetOAuth2ClientOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewOauthAuthParams() + params = NewDynamicClientRegistrationGetOAuth2ClientParams() } - _, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "oauthAuth", + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dynamicClientRegistrationGetOAuth2Client", Method: "GET", - PathPattern: "/oauth2/auth", + PathPattern: "/connect/register/{id}", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &OauthAuthReader{formats: a.formats}, + Reader: &DynamicClientRegistrationGetOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, }) if err != nil { - return err + return nil, err } - return nil + success, ok := result.(*DynamicClientRegistrationGetOAuth2ClientOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DynamicClientRegistrationGetOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } /* - RevokeOAuth2Token revokes o auth2 tokens + DynamicClientRegistrationUpdateOAuth2Client updates an o auth 2 0 client using the open ID o auth2 dynamic client registration management protocol - Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no -longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. -Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by -the client the token was generated for. + This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is capable of facing the +public internet directly and can be used in self-service. It implements the OpenID Connect +Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint +is disabled by default. It can be enabled by an administrator. + +If you pass `client_secret` the secret will be updated and returned via the API. +This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. + +To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client +uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. +If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + +OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are +generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. */ -func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeOAuth2TokenOK, error) { +func (a *Client) DynamicClientRegistrationUpdateOAuth2Client(params *DynamicClientRegistrationUpdateOAuth2ClientParams) (*DynamicClientRegistrationUpdateOAuth2ClientOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewRevokeOAuth2TokenParams() + params = NewDynamicClientRegistrationUpdateOAuth2ClientParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "revokeOAuth2Token", - Method: "POST", - PathPattern: "/oauth2/revoke", + ID: "dynamicClientRegistrationUpdateOAuth2Client", + Method: "PUT", + PathPattern: "/connect/register/{id}", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &RevokeOAuth2TokenReader{formats: a.formats}, - AuthInfo: authInfo, + Reader: &DynamicClientRegistrationUpdateOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, }) if err != nil { return nil, err } - success, ok := result.(*RevokeOAuth2TokenOK) + success, ok := result.(*DynamicClientRegistrationUpdateOAuth2ClientOK) if ok { return success, nil } // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for revokeOAuth2Token: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) + unexpectedSuccess := result.(*DynamicClientRegistrationUpdateOAuth2ClientDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } /* - SelfServiceCreateOAuth2Client registers an o auth 2 0 client using open ID dynamic client registration + IsInstanceReady checks readiness status - This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the -public internet directly and can be used in self-service. It implements the OpenID Connect -Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint -is disabled by default. It can be enabled by an administrator. + This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. +the database) are responsive as well. -Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be -generated. The secret will be returned in the response and you will not be able to retrieve it later on. -Write the secret down and keep it somewhere safe. +If the service supports TLS Edge Termination, this endpoint does not require the +`X-Forwarded-Proto` header to be set. + +Be aware that if you are running multiple nodes of this service, the health status will never +refer to the cluster state, only to a single instance. */ -func (a *Client) SelfServiceCreateOAuth2Client(params *SelfServiceCreateOAuth2ClientParams) (*SelfServiceCreateOAuth2ClientCreated, error) { +func (a *Client) IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceReadyOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewSelfServiceCreateOAuth2ClientParams() + params = NewIsInstanceReadyParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "selfServiceCreateOAuth2Client", - Method: "POST", - PathPattern: "/connect/register", + ID: "isInstanceReady", + Method: "GET", + PathPattern: "/health/ready", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &SelfServiceCreateOAuth2ClientReader{formats: a.formats}, + Reader: &IsInstanceReadyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, }) if err != nil { return nil, err } - success, ok := result.(*SelfServiceCreateOAuth2ClientCreated) + success, ok := result.(*IsInstanceReadyOK) if ok { return success, nil } // unexpected success response - unexpectedSuccess := result.(*SelfServiceCreateOAuth2ClientDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for isInstanceReady: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* - SelfServiceDeleteOAuth2Client deletes an o auth 2 0 client using open ID dynamic client registration - - This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of facing the -public internet directly and can be used in self-service. It implements the OpenID Connect -Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint -is disabled by default. It can be enabled by an administrator. + Oauth2Token thes o auth 2 0 token endpoint -To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client -uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. -If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + The client makes a request to the token endpoint by sending the +following parameters using the "application/x-www-form-urlencoded" HTTP +request entity-body. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are -generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. +> Do not implement a client for this endpoint yourself. Use a library. There are many libraries +> available for any programming language. You can find a list of libraries here: https://oauth.net/code/ +> +> Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed above! */ -func (a *Client) SelfServiceDeleteOAuth2Client(params *SelfServiceDeleteOAuth2ClientParams) (*SelfServiceDeleteOAuth2ClientNoContent, error) { +func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*Oauth2TokenOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewSelfServiceDeleteOAuth2ClientParams() + params = NewOauth2TokenParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "selfServiceDeleteOAuth2Client", - Method: "DELETE", - PathPattern: "/connect/register", + ID: "oauth2Token", + Method: "POST", + PathPattern: "/oauth2/token", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &SelfServiceDeleteOAuth2ClientReader{formats: a.formats}, + Reader: &Oauth2TokenReader{formats: a.formats}, + AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, }) if err != nil { return nil, err } - success, ok := result.(*SelfServiceDeleteOAuth2ClientNoContent) + success, ok := result.(*Oauth2TokenOK) if ok { return success, nil } // unexpected success response - unexpectedSuccess := result.(*SelfServiceDeleteOAuth2ClientDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for oauth2Token: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* - SelfServiceGetOAuth2Client gets an o auth 2 0 client using open ID dynamic client registration - - This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the -public internet directly and can be used in self-service. It implements the OpenID Connect -Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint -is disabled by default. It can be enabled by an administrator. + OauthAuth thes o auth 2 0 authorize endpoint -To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client -uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. -If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + This endpoint is not documented here because you should never use your own implementation to perform OAuth2 flows. +OAuth2 is a very popular protocol and a library for your programming language will exists. -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are -generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. +To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749 */ -func (a *Client) SelfServiceGetOAuth2Client(params *SelfServiceGetOAuth2ClientParams) (*SelfServiceGetOAuth2ClientOK, error) { +func (a *Client) OauthAuth(params *OauthAuthParams) error { // TODO: Validate the params before sending if params == nil { - params = NewSelfServiceGetOAuth2ClientParams() + params = NewOauthAuthParams() } - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "selfServiceGetOAuth2Client", + _, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "oauthAuth", Method: "GET", - PathPattern: "/connect/register", + PathPattern: "/oauth2/auth", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &SelfServiceGetOAuth2ClientReader{formats: a.formats}, + Reader: &OauthAuthReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, }) if err != nil { - return nil, err - } - success, ok := result.(*SelfServiceGetOAuth2ClientOK) - if ok { - return success, nil + return err } - // unexpected success response - unexpectedSuccess := result.(*SelfServiceGetOAuth2ClientDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) + return nil } /* - SelfServiceUpdateOAuth2Client updates an o auth 2 0 client using open ID dynamic client registration - - This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is capable of facing the -public internet directly and can be used in self-service. It implements the OpenID Connect -Dynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint -is disabled by default. It can be enabled by an administrator. - -If you pass `client_secret` the secret will be updated and returned via the API. -This is the only time you will be able to retrieve the client secret, so write it down and keep it safe. - -To use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client -uses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query. -If it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header. + RevokeOAuth2Token revokes o auth2 tokens -OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are -generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. + Revoking a token (both access and refresh) means that the tokens will be invalid. A revoked access token can no +longer be used to make access requests, and a revoked refresh token can no longer be used to refresh an access token. +Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by +the client the token was generated for. */ -func (a *Client) SelfServiceUpdateOAuth2Client(params *SelfServiceUpdateOAuth2ClientParams) (*SelfServiceUpdateOAuth2ClientOK, error) { +func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeOAuth2TokenOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewSelfServiceUpdateOAuth2ClientParams() + params = NewRevokeOAuth2TokenParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "selfServiceUpdateOAuth2Client", - Method: "PUT", - PathPattern: "/connect/register", + ID: "revokeOAuth2Token", + Method: "POST", + PathPattern: "/oauth2/revoke", ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, Schemes: []string{"http", "https"}, Params: params, - Reader: &SelfServiceUpdateOAuth2ClientReader{formats: a.formats}, + Reader: &RevokeOAuth2TokenReader{formats: a.formats}, + AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, }) if err != nil { return nil, err } - success, ok := result.(*SelfServiceUpdateOAuth2ClientOK) + success, ok := result.(*RevokeOAuth2TokenOK) if ok { return success, nil } // unexpected success response - unexpectedSuccess := result.(*SelfServiceUpdateOAuth2ClientDefault) - return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for revokeOAuth2Token: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) } /* diff --git a/internal/httpclient/client/public/self_service_create_o_auth2_client_parameters.go b/internal/httpclient/client/public/self_service_create_o_auth2_client_parameters.go deleted file mode 100644 index 4a037f84298..00000000000 --- a/internal/httpclient/client/public/self_service_create_o_auth2_client_parameters.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// NewSelfServiceCreateOAuth2ClientParams creates a new SelfServiceCreateOAuth2ClientParams object -// with the default values initialized. -func NewSelfServiceCreateOAuth2ClientParams() *SelfServiceCreateOAuth2ClientParams { - var () - return &SelfServiceCreateOAuth2ClientParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewSelfServiceCreateOAuth2ClientParamsWithTimeout creates a new SelfServiceCreateOAuth2ClientParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewSelfServiceCreateOAuth2ClientParamsWithTimeout(timeout time.Duration) *SelfServiceCreateOAuth2ClientParams { - var () - return &SelfServiceCreateOAuth2ClientParams{ - - timeout: timeout, - } -} - -// NewSelfServiceCreateOAuth2ClientParamsWithContext creates a new SelfServiceCreateOAuth2ClientParams object -// with the default values initialized, and the ability to set a context for a request -func NewSelfServiceCreateOAuth2ClientParamsWithContext(ctx context.Context) *SelfServiceCreateOAuth2ClientParams { - var () - return &SelfServiceCreateOAuth2ClientParams{ - - Context: ctx, - } -} - -// NewSelfServiceCreateOAuth2ClientParamsWithHTTPClient creates a new SelfServiceCreateOAuth2ClientParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewSelfServiceCreateOAuth2ClientParamsWithHTTPClient(client *http.Client) *SelfServiceCreateOAuth2ClientParams { - var () - return &SelfServiceCreateOAuth2ClientParams{ - HTTPClient: client, - } -} - -/*SelfServiceCreateOAuth2ClientParams contains all the parameters to send to the API endpoint -for the self service create o auth2 client operation typically these are written to a http.Request -*/ -type SelfServiceCreateOAuth2ClientParams struct { - - /*Body*/ - Body *models.OAuth2Client - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the self service create o auth2 client params -func (o *SelfServiceCreateOAuth2ClientParams) WithTimeout(timeout time.Duration) *SelfServiceCreateOAuth2ClientParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the self service create o auth2 client params -func (o *SelfServiceCreateOAuth2ClientParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the self service create o auth2 client params -func (o *SelfServiceCreateOAuth2ClientParams) WithContext(ctx context.Context) *SelfServiceCreateOAuth2ClientParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the self service create o auth2 client params -func (o *SelfServiceCreateOAuth2ClientParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the self service create o auth2 client params -func (o *SelfServiceCreateOAuth2ClientParams) WithHTTPClient(client *http.Client) *SelfServiceCreateOAuth2ClientParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the self service create o auth2 client params -func (o *SelfServiceCreateOAuth2ClientParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the self service create o auth2 client params -func (o *SelfServiceCreateOAuth2ClientParams) WithBody(body *models.OAuth2Client) *SelfServiceCreateOAuth2ClientParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the self service create o auth2 client params -func (o *SelfServiceCreateOAuth2ClientParams) SetBody(body *models.OAuth2Client) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *SelfServiceCreateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/self_service_create_o_auth2_client_responses.go b/internal/httpclient/client/public/self_service_create_o_auth2_client_responses.go deleted file mode 100644 index 000e9c4dd5d..00000000000 --- a/internal/httpclient/client/public/self_service_create_o_auth2_client_responses.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// SelfServiceCreateOAuth2ClientReader is a Reader for the SelfServiceCreateOAuth2Client structure. -type SelfServiceCreateOAuth2ClientReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *SelfServiceCreateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewSelfServiceCreateOAuth2ClientCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewSelfServiceCreateOAuth2ClientDefault(response.Code()) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - if response.Code()/100 == 2 { - return result, nil - } - return nil, result - } -} - -// NewSelfServiceCreateOAuth2ClientCreated creates a SelfServiceCreateOAuth2ClientCreated with default headers values -func NewSelfServiceCreateOAuth2ClientCreated() *SelfServiceCreateOAuth2ClientCreated { - return &SelfServiceCreateOAuth2ClientCreated{} -} - -/*SelfServiceCreateOAuth2ClientCreated handles this case with default header values. - -oAuth2Client -*/ -type SelfServiceCreateOAuth2ClientCreated struct { - Payload *models.OAuth2Client -} - -func (o *SelfServiceCreateOAuth2ClientCreated) Error() string { - return fmt.Sprintf("[POST /connect/register][%d] selfServiceCreateOAuth2ClientCreated %+v", 201, o.Payload) -} - -func (o *SelfServiceCreateOAuth2ClientCreated) GetPayload() *models.OAuth2Client { - return o.Payload -} - -func (o *SelfServiceCreateOAuth2ClientCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OAuth2Client) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewSelfServiceCreateOAuth2ClientDefault creates a SelfServiceCreateOAuth2ClientDefault with default headers values -func NewSelfServiceCreateOAuth2ClientDefault(code int) *SelfServiceCreateOAuth2ClientDefault { - return &SelfServiceCreateOAuth2ClientDefault{ - _statusCode: code, - } -} - -/*SelfServiceCreateOAuth2ClientDefault handles this case with default header values. - -jsonError -*/ -type SelfServiceCreateOAuth2ClientDefault struct { - _statusCode int - - Payload *models.JSONError -} - -// Code gets the status code for the self service create o auth2 client default response -func (o *SelfServiceCreateOAuth2ClientDefault) Code() int { - return o._statusCode -} - -func (o *SelfServiceCreateOAuth2ClientDefault) Error() string { - return fmt.Sprintf("[POST /connect/register][%d] selfServiceCreateOAuth2Client default %+v", o._statusCode, o.Payload) -} - -func (o *SelfServiceCreateOAuth2ClientDefault) GetPayload() *models.JSONError { - return o.Payload -} - -func (o *SelfServiceCreateOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JSONError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/self_service_delete_o_auth2_client_parameters.go b/internal/httpclient/client/public/self_service_delete_o_auth2_client_parameters.go deleted file mode 100644 index b4411577658..00000000000 --- a/internal/httpclient/client/public/self_service_delete_o_auth2_client_parameters.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewSelfServiceDeleteOAuth2ClientParams creates a new SelfServiceDeleteOAuth2ClientParams object -// with the default values initialized. -func NewSelfServiceDeleteOAuth2ClientParams() *SelfServiceDeleteOAuth2ClientParams { - var () - return &SelfServiceDeleteOAuth2ClientParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewSelfServiceDeleteOAuth2ClientParamsWithTimeout creates a new SelfServiceDeleteOAuth2ClientParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewSelfServiceDeleteOAuth2ClientParamsWithTimeout(timeout time.Duration) *SelfServiceDeleteOAuth2ClientParams { - var () - return &SelfServiceDeleteOAuth2ClientParams{ - - timeout: timeout, - } -} - -// NewSelfServiceDeleteOAuth2ClientParamsWithContext creates a new SelfServiceDeleteOAuth2ClientParams object -// with the default values initialized, and the ability to set a context for a request -func NewSelfServiceDeleteOAuth2ClientParamsWithContext(ctx context.Context) *SelfServiceDeleteOAuth2ClientParams { - var () - return &SelfServiceDeleteOAuth2ClientParams{ - - Context: ctx, - } -} - -// NewSelfServiceDeleteOAuth2ClientParamsWithHTTPClient creates a new SelfServiceDeleteOAuth2ClientParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewSelfServiceDeleteOAuth2ClientParamsWithHTTPClient(client *http.Client) *SelfServiceDeleteOAuth2ClientParams { - var () - return &SelfServiceDeleteOAuth2ClientParams{ - HTTPClient: client, - } -} - -/*SelfServiceDeleteOAuth2ClientParams contains all the parameters to send to the API endpoint -for the self service delete o auth2 client operation typically these are written to a http.Request -*/ -type SelfServiceDeleteOAuth2ClientParams struct { - - /*ClientID*/ - ClientID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the self service delete o auth2 client params -func (o *SelfServiceDeleteOAuth2ClientParams) WithTimeout(timeout time.Duration) *SelfServiceDeleteOAuth2ClientParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the self service delete o auth2 client params -func (o *SelfServiceDeleteOAuth2ClientParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the self service delete o auth2 client params -func (o *SelfServiceDeleteOAuth2ClientParams) WithContext(ctx context.Context) *SelfServiceDeleteOAuth2ClientParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the self service delete o auth2 client params -func (o *SelfServiceDeleteOAuth2ClientParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the self service delete o auth2 client params -func (o *SelfServiceDeleteOAuth2ClientParams) WithHTTPClient(client *http.Client) *SelfServiceDeleteOAuth2ClientParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the self service delete o auth2 client params -func (o *SelfServiceDeleteOAuth2ClientParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithClientID adds the clientID to the self service delete o auth2 client params -func (o *SelfServiceDeleteOAuth2ClientParams) WithClientID(clientID string) *SelfServiceDeleteOAuth2ClientParams { - o.SetClientID(clientID) - return o -} - -// SetClientID adds the clientId to the self service delete o auth2 client params -func (o *SelfServiceDeleteOAuth2ClientParams) SetClientID(clientID string) { - o.ClientID = clientID -} - -// WriteToRequest writes these params to a swagger request -func (o *SelfServiceDeleteOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param client_id - qrClientID := o.ClientID - qClientID := qrClientID - if qClientID != "" { - if err := r.SetQueryParam("client_id", qClientID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/self_service_delete_o_auth2_client_responses.go b/internal/httpclient/client/public/self_service_delete_o_auth2_client_responses.go deleted file mode 100644 index 77880ff208d..00000000000 --- a/internal/httpclient/client/public/self_service_delete_o_auth2_client_responses.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// SelfServiceDeleteOAuth2ClientReader is a Reader for the SelfServiceDeleteOAuth2Client structure. -type SelfServiceDeleteOAuth2ClientReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *SelfServiceDeleteOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewSelfServiceDeleteOAuth2ClientNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewSelfServiceDeleteOAuth2ClientDefault(response.Code()) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - if response.Code()/100 == 2 { - return result, nil - } - return nil, result - } -} - -// NewSelfServiceDeleteOAuth2ClientNoContent creates a SelfServiceDeleteOAuth2ClientNoContent with default headers values -func NewSelfServiceDeleteOAuth2ClientNoContent() *SelfServiceDeleteOAuth2ClientNoContent { - return &SelfServiceDeleteOAuth2ClientNoContent{} -} - -/*SelfServiceDeleteOAuth2ClientNoContent handles this case with default header values. - -Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201. -*/ -type SelfServiceDeleteOAuth2ClientNoContent struct { -} - -func (o *SelfServiceDeleteOAuth2ClientNoContent) Error() string { - return fmt.Sprintf("[DELETE /connect/register][%d] selfServiceDeleteOAuth2ClientNoContent ", 204) -} - -func (o *SelfServiceDeleteOAuth2ClientNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewSelfServiceDeleteOAuth2ClientDefault creates a SelfServiceDeleteOAuth2ClientDefault with default headers values -func NewSelfServiceDeleteOAuth2ClientDefault(code int) *SelfServiceDeleteOAuth2ClientDefault { - return &SelfServiceDeleteOAuth2ClientDefault{ - _statusCode: code, - } -} - -/*SelfServiceDeleteOAuth2ClientDefault handles this case with default header values. - -jsonError -*/ -type SelfServiceDeleteOAuth2ClientDefault struct { - _statusCode int - - Payload *models.JSONError -} - -// Code gets the status code for the self service delete o auth2 client default response -func (o *SelfServiceDeleteOAuth2ClientDefault) Code() int { - return o._statusCode -} - -func (o *SelfServiceDeleteOAuth2ClientDefault) Error() string { - return fmt.Sprintf("[DELETE /connect/register][%d] selfServiceDeleteOAuth2Client default %+v", o._statusCode, o.Payload) -} - -func (o *SelfServiceDeleteOAuth2ClientDefault) GetPayload() *models.JSONError { - return o.Payload -} - -func (o *SelfServiceDeleteOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JSONError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/self_service_get_o_auth2_client_parameters.go b/internal/httpclient/client/public/self_service_get_o_auth2_client_parameters.go deleted file mode 100644 index 94f81df3178..00000000000 --- a/internal/httpclient/client/public/self_service_get_o_auth2_client_parameters.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewSelfServiceGetOAuth2ClientParams creates a new SelfServiceGetOAuth2ClientParams object -// with the default values initialized. -func NewSelfServiceGetOAuth2ClientParams() *SelfServiceGetOAuth2ClientParams { - - return &SelfServiceGetOAuth2ClientParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewSelfServiceGetOAuth2ClientParamsWithTimeout creates a new SelfServiceGetOAuth2ClientParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewSelfServiceGetOAuth2ClientParamsWithTimeout(timeout time.Duration) *SelfServiceGetOAuth2ClientParams { - - return &SelfServiceGetOAuth2ClientParams{ - - timeout: timeout, - } -} - -// NewSelfServiceGetOAuth2ClientParamsWithContext creates a new SelfServiceGetOAuth2ClientParams object -// with the default values initialized, and the ability to set a context for a request -func NewSelfServiceGetOAuth2ClientParamsWithContext(ctx context.Context) *SelfServiceGetOAuth2ClientParams { - - return &SelfServiceGetOAuth2ClientParams{ - - Context: ctx, - } -} - -// NewSelfServiceGetOAuth2ClientParamsWithHTTPClient creates a new SelfServiceGetOAuth2ClientParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewSelfServiceGetOAuth2ClientParamsWithHTTPClient(client *http.Client) *SelfServiceGetOAuth2ClientParams { - - return &SelfServiceGetOAuth2ClientParams{ - HTTPClient: client, - } -} - -/*SelfServiceGetOAuth2ClientParams contains all the parameters to send to the API endpoint -for the self service get o auth2 client operation typically these are written to a http.Request -*/ -type SelfServiceGetOAuth2ClientParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the self service get o auth2 client params -func (o *SelfServiceGetOAuth2ClientParams) WithTimeout(timeout time.Duration) *SelfServiceGetOAuth2ClientParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the self service get o auth2 client params -func (o *SelfServiceGetOAuth2ClientParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the self service get o auth2 client params -func (o *SelfServiceGetOAuth2ClientParams) WithContext(ctx context.Context) *SelfServiceGetOAuth2ClientParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the self service get o auth2 client params -func (o *SelfServiceGetOAuth2ClientParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the self service get o auth2 client params -func (o *SelfServiceGetOAuth2ClientParams) WithHTTPClient(client *http.Client) *SelfServiceGetOAuth2ClientParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the self service get o auth2 client params -func (o *SelfServiceGetOAuth2ClientParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *SelfServiceGetOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/self_service_get_o_auth2_client_responses.go b/internal/httpclient/client/public/self_service_get_o_auth2_client_responses.go deleted file mode 100644 index 116b8dd70e0..00000000000 --- a/internal/httpclient/client/public/self_service_get_o_auth2_client_responses.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// SelfServiceGetOAuth2ClientReader is a Reader for the SelfServiceGetOAuth2Client structure. -type SelfServiceGetOAuth2ClientReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *SelfServiceGetOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewSelfServiceGetOAuth2ClientOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewSelfServiceGetOAuth2ClientDefault(response.Code()) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - if response.Code()/100 == 2 { - return result, nil - } - return nil, result - } -} - -// NewSelfServiceGetOAuth2ClientOK creates a SelfServiceGetOAuth2ClientOK with default headers values -func NewSelfServiceGetOAuth2ClientOK() *SelfServiceGetOAuth2ClientOK { - return &SelfServiceGetOAuth2ClientOK{} -} - -/*SelfServiceGetOAuth2ClientOK handles this case with default header values. - -oAuth2Client -*/ -type SelfServiceGetOAuth2ClientOK struct { - Payload *models.OAuth2Client -} - -func (o *SelfServiceGetOAuth2ClientOK) Error() string { - return fmt.Sprintf("[GET /connect/register][%d] selfServiceGetOAuth2ClientOK %+v", 200, o.Payload) -} - -func (o *SelfServiceGetOAuth2ClientOK) GetPayload() *models.OAuth2Client { - return o.Payload -} - -func (o *SelfServiceGetOAuth2ClientOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OAuth2Client) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewSelfServiceGetOAuth2ClientDefault creates a SelfServiceGetOAuth2ClientDefault with default headers values -func NewSelfServiceGetOAuth2ClientDefault(code int) *SelfServiceGetOAuth2ClientDefault { - return &SelfServiceGetOAuth2ClientDefault{ - _statusCode: code, - } -} - -/*SelfServiceGetOAuth2ClientDefault handles this case with default header values. - -jsonError -*/ -type SelfServiceGetOAuth2ClientDefault struct { - _statusCode int - - Payload *models.JSONError -} - -// Code gets the status code for the self service get o auth2 client default response -func (o *SelfServiceGetOAuth2ClientDefault) Code() int { - return o._statusCode -} - -func (o *SelfServiceGetOAuth2ClientDefault) Error() string { - return fmt.Sprintf("[GET /connect/register][%d] selfServiceGetOAuth2Client default %+v", o._statusCode, o.Payload) -} - -func (o *SelfServiceGetOAuth2ClientDefault) GetPayload() *models.JSONError { - return o.Payload -} - -func (o *SelfServiceGetOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JSONError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/client/public/self_service_update_o_auth2_client_parameters.go b/internal/httpclient/client/public/self_service_update_o_auth2_client_parameters.go deleted file mode 100644 index 39ff3fc29c9..00000000000 --- a/internal/httpclient/client/public/self_service_update_o_auth2_client_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// NewSelfServiceUpdateOAuth2ClientParams creates a new SelfServiceUpdateOAuth2ClientParams object -// with the default values initialized. -func NewSelfServiceUpdateOAuth2ClientParams() *SelfServiceUpdateOAuth2ClientParams { - var () - return &SelfServiceUpdateOAuth2ClientParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewSelfServiceUpdateOAuth2ClientParamsWithTimeout creates a new SelfServiceUpdateOAuth2ClientParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewSelfServiceUpdateOAuth2ClientParamsWithTimeout(timeout time.Duration) *SelfServiceUpdateOAuth2ClientParams { - var () - return &SelfServiceUpdateOAuth2ClientParams{ - - timeout: timeout, - } -} - -// NewSelfServiceUpdateOAuth2ClientParamsWithContext creates a new SelfServiceUpdateOAuth2ClientParams object -// with the default values initialized, and the ability to set a context for a request -func NewSelfServiceUpdateOAuth2ClientParamsWithContext(ctx context.Context) *SelfServiceUpdateOAuth2ClientParams { - var () - return &SelfServiceUpdateOAuth2ClientParams{ - - Context: ctx, - } -} - -// NewSelfServiceUpdateOAuth2ClientParamsWithHTTPClient creates a new SelfServiceUpdateOAuth2ClientParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewSelfServiceUpdateOAuth2ClientParamsWithHTTPClient(client *http.Client) *SelfServiceUpdateOAuth2ClientParams { - var () - return &SelfServiceUpdateOAuth2ClientParams{ - HTTPClient: client, - } -} - -/*SelfServiceUpdateOAuth2ClientParams contains all the parameters to send to the API endpoint -for the self service update o auth2 client operation typically these are written to a http.Request -*/ -type SelfServiceUpdateOAuth2ClientParams struct { - - /*Body*/ - Body *models.OAuth2Client - /*ClientID*/ - ClientID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the self service update o auth2 client params -func (o *SelfServiceUpdateOAuth2ClientParams) WithTimeout(timeout time.Duration) *SelfServiceUpdateOAuth2ClientParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the self service update o auth2 client params -func (o *SelfServiceUpdateOAuth2ClientParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the self service update o auth2 client params -func (o *SelfServiceUpdateOAuth2ClientParams) WithContext(ctx context.Context) *SelfServiceUpdateOAuth2ClientParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the self service update o auth2 client params -func (o *SelfServiceUpdateOAuth2ClientParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the self service update o auth2 client params -func (o *SelfServiceUpdateOAuth2ClientParams) WithHTTPClient(client *http.Client) *SelfServiceUpdateOAuth2ClientParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the self service update o auth2 client params -func (o *SelfServiceUpdateOAuth2ClientParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the self service update o auth2 client params -func (o *SelfServiceUpdateOAuth2ClientParams) WithBody(body *models.OAuth2Client) *SelfServiceUpdateOAuth2ClientParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the self service update o auth2 client params -func (o *SelfServiceUpdateOAuth2ClientParams) SetBody(body *models.OAuth2Client) { - o.Body = body -} - -// WithClientID adds the clientID to the self service update o auth2 client params -func (o *SelfServiceUpdateOAuth2ClientParams) WithClientID(clientID string) *SelfServiceUpdateOAuth2ClientParams { - o.SetClientID(clientID) - return o -} - -// SetClientID adds the clientId to the self service update o auth2 client params -func (o *SelfServiceUpdateOAuth2ClientParams) SetClientID(clientID string) { - o.ClientID = clientID -} - -// WriteToRequest writes these params to a swagger request -func (o *SelfServiceUpdateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // query param client_id - qrClientID := o.ClientID - qClientID := qrClientID - if qClientID != "" { - if err := r.SetQueryParam("client_id", qClientID); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/internal/httpclient/client/public/self_service_update_o_auth2_client_responses.go b/internal/httpclient/client/public/self_service_update_o_auth2_client_responses.go deleted file mode 100644 index 6e443fca5c3..00000000000 --- a/internal/httpclient/client/public/self_service_update_o_auth2_client_responses.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package public - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/ory/hydra/internal/httpclient/models" -) - -// SelfServiceUpdateOAuth2ClientReader is a Reader for the SelfServiceUpdateOAuth2Client structure. -type SelfServiceUpdateOAuth2ClientReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *SelfServiceUpdateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewSelfServiceUpdateOAuth2ClientOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - result := NewSelfServiceUpdateOAuth2ClientDefault(response.Code()) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - if response.Code()/100 == 2 { - return result, nil - } - return nil, result - } -} - -// NewSelfServiceUpdateOAuth2ClientOK creates a SelfServiceUpdateOAuth2ClientOK with default headers values -func NewSelfServiceUpdateOAuth2ClientOK() *SelfServiceUpdateOAuth2ClientOK { - return &SelfServiceUpdateOAuth2ClientOK{} -} - -/*SelfServiceUpdateOAuth2ClientOK handles this case with default header values. - -oAuth2Client -*/ -type SelfServiceUpdateOAuth2ClientOK struct { - Payload *models.OAuth2Client -} - -func (o *SelfServiceUpdateOAuth2ClientOK) Error() string { - return fmt.Sprintf("[PUT /connect/register][%d] selfServiceUpdateOAuth2ClientOK %+v", 200, o.Payload) -} - -func (o *SelfServiceUpdateOAuth2ClientOK) GetPayload() *models.OAuth2Client { - return o.Payload -} - -func (o *SelfServiceUpdateOAuth2ClientOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.OAuth2Client) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewSelfServiceUpdateOAuth2ClientDefault creates a SelfServiceUpdateOAuth2ClientDefault with default headers values -func NewSelfServiceUpdateOAuth2ClientDefault(code int) *SelfServiceUpdateOAuth2ClientDefault { - return &SelfServiceUpdateOAuth2ClientDefault{ - _statusCode: code, - } -} - -/*SelfServiceUpdateOAuth2ClientDefault handles this case with default header values. - -jsonError -*/ -type SelfServiceUpdateOAuth2ClientDefault struct { - _statusCode int - - Payload *models.JSONError -} - -// Code gets the status code for the self service update o auth2 client default response -func (o *SelfServiceUpdateOAuth2ClientDefault) Code() int { - return o._statusCode -} - -func (o *SelfServiceUpdateOAuth2ClientDefault) Error() string { - return fmt.Sprintf("[PUT /connect/register][%d] selfServiceUpdateOAuth2Client default %+v", o._statusCode, o.Payload) -} - -func (o *SelfServiceUpdateOAuth2ClientDefault) GetPayload() *models.JSONError { - return o.Payload -} - -func (o *SelfServiceUpdateOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.JSONError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/internal/httpclient/models/o_auth2_client.go b/internal/httpclient/models/o_auth2_client.go index 0324fb28bef..7764deb2f46 100644 --- a/internal/httpclient/models/o_auth2_client.go +++ b/internal/httpclient/models/o_auth2_client.go @@ -111,6 +111,12 @@ type OAuth2Client struct { // redirect uris RedirectUris StringSlicePipeDelimiter `json:"redirect_uris,omitempty"` + // RegistrationAccessToken can be used to update, get, or delete the OAuth2 Client. + RegistrationAccessToken string `json:"registration_access_token,omitempty"` + + // RegistrationClientURI is the URL used to update, get, or delete the OAuth2 Client. + RegistrationClientURI string `json:"registration_client_uri,omitempty"` + // JWS [JWS] alg algorithm [JWA] that MUST be used for signing Request Objects sent to the OP. All Request Objects // from this Client MUST be rejected, if not signed with this algorithm. RequestObjectSigningAlg string `json:"request_object_signing_alg,omitempty"` diff --git a/spec/api.json b/spec/api.json index 59f2aa944f6..f6a41970f08 100755 --- a/spec/api.json +++ b/spec/api.json @@ -374,8 +374,8 @@ } }, "/connect/register": { - "get": { - "description": "This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the\npublic internet directly and can be used in self-service. It implements the OpenID Connect\nDynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint\nis disabled by default. It can be enabled by an administrator.\n\nTo use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client\nuses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query.\nIf it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", + "post": { + "description": "This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the\npublic internet directly and can be used in self-service. It implements the OpenID Connect\nDynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint\nis disabled by default. It can be enabled by an administrator.\n\nPlease note that using this endpoint you are not able to choose the `client_secret` nor the `client_id` as those\nvalues will be server generated when specifying `token_endpoint_auth_method` as `client_secret_basic` or\n`client_secret_post`.\n\nThe `client_secret` will be returned in the response and you will not be able to retrieve it later on.\nWrite the secret down and keep it somewhere safe.", "consumes": [ "application/json" ], @@ -389,10 +389,20 @@ "tags": [ "public" ], - "summary": "Get an OAuth 2.0 Client using OpenID Dynamic Client Registration", - "operationId": "selfServiceGetOAuth2Client", + "summary": "Register an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol", + "operationId": "dynamicClientRegistrationCreateOAuth2Client", + "parameters": [ + { + "name": "Body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/oAuth2Client" + } + } + ], "responses": { - "200": { + "201": { "description": "oAuth2Client", "schema": { "$ref": "#/definitions/oAuth2Client" @@ -405,9 +415,11 @@ } } } - }, - "put": { - "description": "This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is capable of facing the\npublic internet directly and can be used in self-service. It implements the OpenID Connect\nDynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint\nis disabled by default. It can be enabled by an administrator.\n\nIf you pass `client_secret` the secret will be updated and returned via the API.\nThis is the only time you will be able to retrieve the client secret, so write it down and keep it safe.\n\nTo use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client\nuses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query.\nIf it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", + } + }, + "/connect/register/{id}": { + "get": { + "description": "This endpoint behaves like the administrative counterpart (`getOAuth2Client`) but is capable of facing the\npublic internet directly and can be used in self-service. It implements the OpenID Connect\nDynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint\nis disabled by default. It can be enabled by an administrator.\n\nTo use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client\nuses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query.\nIf it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", "consumes": [ "application/json" ], @@ -421,22 +433,14 @@ "tags": [ "public" ], - "summary": "Update an OAuth 2.0 Client using OpenID Dynamic Client Registration", - "operationId": "selfServiceUpdateOAuth2Client", + "summary": "Get an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol", + "operationId": "dynamicClientRegistrationGetOAuth2Client", "parameters": [ { "type": "string", - "name": "client_id", - "in": "query", + "name": "id", + "in": "path", "required": true - }, - { - "name": "Body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/oAuth2Client" - } } ], "responses": { @@ -454,8 +458,8 @@ } } }, - "post": { - "description": "This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the\npublic internet directly and can be used in self-service. It implements the OpenID Connect\nDynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint\nis disabled by default. It can be enabled by an administrator.\n\nCreate a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be\ngenerated. The secret will be returned in the response and you will not be able to retrieve it later on.\nWrite the secret down and keep it somewhere safe.", + "put": { + "description": "This endpoint behaves like the administrative counterpart (`updateOAuth2Client`) but is capable of facing the\npublic internet directly and can be used in self-service. It implements the OpenID Connect\nDynamic Client Registration Protocol. This feature needs to be enabled in the configuration. This endpoint\nis disabled by default. It can be enabled by an administrator.\n\nIf you pass `client_secret` the secret will be updated and returned via the API.\nThis is the only time you will be able to retrieve the client secret, so write it down and keep it safe.\n\nTo use this endpoint, you will need to present the client's authentication credentials. If the OAuth2 Client\nuses the Token Endpoint Authentication Method `client_secret_post`, you need to present the client secret in the URL query.\nIf it uses `client_secret_basic`, present the Client ID and the Client Secret in the Authorization header.\n\nOAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", "consumes": [ "application/json" ], @@ -469,9 +473,15 @@ "tags": [ "public" ], - "summary": "Register an OAuth 2.0 Client using OpenID Dynamic Client Registration", - "operationId": "selfServiceCreateOAuth2Client", + "summary": "Update an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol", + "operationId": "dynamicClientRegistrationUpdateOAuth2Client", "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + }, { "name": "Body", "in": "body", @@ -482,7 +492,7 @@ } ], "responses": { - "201": { + "200": { "description": "oAuth2Client", "schema": { "$ref": "#/definitions/oAuth2Client" @@ -508,13 +518,13 @@ "tags": [ "public" ], - "summary": "Deletes an OAuth 2.0 Client using OpenID Dynamic Client Registration", - "operationId": "selfServiceDeleteOAuth2Client", + "summary": "Deletes an OAuth 2.0 Client using the OpenID / OAuth2 Dynamic Client Registration Management Protocol", + "operationId": "dynamicClientRegistrationDeleteOAuth2Client", "parameters": [ { "type": "string", - "name": "client_id", - "in": "query", + "name": "id", + "in": "path", "required": true } ], @@ -3324,6 +3334,14 @@ "redirect_uris": { "$ref": "#/definitions/StringSlicePipeDelimiter" }, + "registration_access_token": { + "description": "RegistrationAccessToken can be used to update, get, or delete the OAuth2 Client.", + "type": "string" + }, + "registration_client_uri": { + "description": "RegistrationClientURI is the URL used to update, get, or delete the OAuth2 Client.", + "type": "string" + }, "request_object_signing_alg": { "description": "JWS [JWS] alg algorithm [JWA] that MUST be used for signing Request Objects sent to the OP. All Request Objects\nfrom this Client MUST be rejected, if not signed with this algorithm.", "type": "string" From ec6bc6db3f682963395ba1d401d31a26a9aa2193 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:40:53 +0200 Subject: [PATCH 37/41] u --- ...ration_create_o_auth2_client_parameters.go | 135 ++++++++++++++++ ...tration_create_o_auth2_client_responses.go | 117 ++++++++++++++ ...ration_delete_o_auth2_client_parameters.go | 132 +++++++++++++++ ...tration_delete_o_auth2_client_responses.go | 106 ++++++++++++ ...istration_get_o_auth2_client_parameters.go | 132 +++++++++++++++ ...gistration_get_o_auth2_client_responses.go | 117 ++++++++++++++ ...ration_update_o_auth2_client_parameters.go | 153 ++++++++++++++++++ ...tration_update_o_auth2_client_responses.go | 117 ++++++++++++++ 8 files changed, 1009 insertions(+) create mode 100644 internal/httpclient/client/public/dynamic_client_registration_create_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/dynamic_client_registration_create_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/dynamic_client_registration_delete_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/dynamic_client_registration_delete_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/dynamic_client_registration_get_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/dynamic_client_registration_get_o_auth2_client_responses.go create mode 100644 internal/httpclient/client/public/dynamic_client_registration_update_o_auth2_client_parameters.go create mode 100644 internal/httpclient/client/public/dynamic_client_registration_update_o_auth2_client_responses.go diff --git a/internal/httpclient/client/public/dynamic_client_registration_create_o_auth2_client_parameters.go b/internal/httpclient/client/public/dynamic_client_registration_create_o_auth2_client_parameters.go new file mode 100644 index 00000000000..6d22a715d3a --- /dev/null +++ b/internal/httpclient/client/public/dynamic_client_registration_create_o_auth2_client_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// NewDynamicClientRegistrationCreateOAuth2ClientParams creates a new DynamicClientRegistrationCreateOAuth2ClientParams object +// with the default values initialized. +func NewDynamicClientRegistrationCreateOAuth2ClientParams() *DynamicClientRegistrationCreateOAuth2ClientParams { + var () + return &DynamicClientRegistrationCreateOAuth2ClientParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDynamicClientRegistrationCreateOAuth2ClientParamsWithTimeout creates a new DynamicClientRegistrationCreateOAuth2ClientParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDynamicClientRegistrationCreateOAuth2ClientParamsWithTimeout(timeout time.Duration) *DynamicClientRegistrationCreateOAuth2ClientParams { + var () + return &DynamicClientRegistrationCreateOAuth2ClientParams{ + + timeout: timeout, + } +} + +// NewDynamicClientRegistrationCreateOAuth2ClientParamsWithContext creates a new DynamicClientRegistrationCreateOAuth2ClientParams object +// with the default values initialized, and the ability to set a context for a request +func NewDynamicClientRegistrationCreateOAuth2ClientParamsWithContext(ctx context.Context) *DynamicClientRegistrationCreateOAuth2ClientParams { + var () + return &DynamicClientRegistrationCreateOAuth2ClientParams{ + + Context: ctx, + } +} + +// NewDynamicClientRegistrationCreateOAuth2ClientParamsWithHTTPClient creates a new DynamicClientRegistrationCreateOAuth2ClientParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDynamicClientRegistrationCreateOAuth2ClientParamsWithHTTPClient(client *http.Client) *DynamicClientRegistrationCreateOAuth2ClientParams { + var () + return &DynamicClientRegistrationCreateOAuth2ClientParams{ + HTTPClient: client, + } +} + +/*DynamicClientRegistrationCreateOAuth2ClientParams contains all the parameters to send to the API endpoint +for the dynamic client registration create o auth2 client operation typically these are written to a http.Request +*/ +type DynamicClientRegistrationCreateOAuth2ClientParams struct { + + /*Body*/ + Body *models.OAuth2Client + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dynamic client registration create o auth2 client params +func (o *DynamicClientRegistrationCreateOAuth2ClientParams) WithTimeout(timeout time.Duration) *DynamicClientRegistrationCreateOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dynamic client registration create o auth2 client params +func (o *DynamicClientRegistrationCreateOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dynamic client registration create o auth2 client params +func (o *DynamicClientRegistrationCreateOAuth2ClientParams) WithContext(ctx context.Context) *DynamicClientRegistrationCreateOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dynamic client registration create o auth2 client params +func (o *DynamicClientRegistrationCreateOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dynamic client registration create o auth2 client params +func (o *DynamicClientRegistrationCreateOAuth2ClientParams) WithHTTPClient(client *http.Client) *DynamicClientRegistrationCreateOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dynamic client registration create o auth2 client params +func (o *DynamicClientRegistrationCreateOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the dynamic client registration create o auth2 client params +func (o *DynamicClientRegistrationCreateOAuth2ClientParams) WithBody(body *models.OAuth2Client) *DynamicClientRegistrationCreateOAuth2ClientParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the dynamic client registration create o auth2 client params +func (o *DynamicClientRegistrationCreateOAuth2ClientParams) SetBody(body *models.OAuth2Client) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *DynamicClientRegistrationCreateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/dynamic_client_registration_create_o_auth2_client_responses.go b/internal/httpclient/client/public/dynamic_client_registration_create_o_auth2_client_responses.go new file mode 100644 index 00000000000..c8cfed730c9 --- /dev/null +++ b/internal/httpclient/client/public/dynamic_client_registration_create_o_auth2_client_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// DynamicClientRegistrationCreateOAuth2ClientReader is a Reader for the DynamicClientRegistrationCreateOAuth2Client structure. +type DynamicClientRegistrationCreateOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DynamicClientRegistrationCreateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewDynamicClientRegistrationCreateOAuth2ClientCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDynamicClientRegistrationCreateOAuth2ClientDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDynamicClientRegistrationCreateOAuth2ClientCreated creates a DynamicClientRegistrationCreateOAuth2ClientCreated with default headers values +func NewDynamicClientRegistrationCreateOAuth2ClientCreated() *DynamicClientRegistrationCreateOAuth2ClientCreated { + return &DynamicClientRegistrationCreateOAuth2ClientCreated{} +} + +/*DynamicClientRegistrationCreateOAuth2ClientCreated handles this case with default header values. + +oAuth2Client +*/ +type DynamicClientRegistrationCreateOAuth2ClientCreated struct { + Payload *models.OAuth2Client +} + +func (o *DynamicClientRegistrationCreateOAuth2ClientCreated) Error() string { + return fmt.Sprintf("[POST /connect/register][%d] dynamicClientRegistrationCreateOAuth2ClientCreated %+v", 201, o.Payload) +} + +func (o *DynamicClientRegistrationCreateOAuth2ClientCreated) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *DynamicClientRegistrationCreateOAuth2ClientCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDynamicClientRegistrationCreateOAuth2ClientDefault creates a DynamicClientRegistrationCreateOAuth2ClientDefault with default headers values +func NewDynamicClientRegistrationCreateOAuth2ClientDefault(code int) *DynamicClientRegistrationCreateOAuth2ClientDefault { + return &DynamicClientRegistrationCreateOAuth2ClientDefault{ + _statusCode: code, + } +} + +/*DynamicClientRegistrationCreateOAuth2ClientDefault handles this case with default header values. + +jsonError +*/ +type DynamicClientRegistrationCreateOAuth2ClientDefault struct { + _statusCode int + + Payload *models.JSONError +} + +// Code gets the status code for the dynamic client registration create o auth2 client default response +func (o *DynamicClientRegistrationCreateOAuth2ClientDefault) Code() int { + return o._statusCode +} + +func (o *DynamicClientRegistrationCreateOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[POST /connect/register][%d] dynamicClientRegistrationCreateOAuth2Client default %+v", o._statusCode, o.Payload) +} + +func (o *DynamicClientRegistrationCreateOAuth2ClientDefault) GetPayload() *models.JSONError { + return o.Payload +} + +func (o *DynamicClientRegistrationCreateOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JSONError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/dynamic_client_registration_delete_o_auth2_client_parameters.go b/internal/httpclient/client/public/dynamic_client_registration_delete_o_auth2_client_parameters.go new file mode 100644 index 00000000000..91957c7e32b --- /dev/null +++ b/internal/httpclient/client/public/dynamic_client_registration_delete_o_auth2_client_parameters.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDynamicClientRegistrationDeleteOAuth2ClientParams creates a new DynamicClientRegistrationDeleteOAuth2ClientParams object +// with the default values initialized. +func NewDynamicClientRegistrationDeleteOAuth2ClientParams() *DynamicClientRegistrationDeleteOAuth2ClientParams { + var () + return &DynamicClientRegistrationDeleteOAuth2ClientParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDynamicClientRegistrationDeleteOAuth2ClientParamsWithTimeout creates a new DynamicClientRegistrationDeleteOAuth2ClientParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDynamicClientRegistrationDeleteOAuth2ClientParamsWithTimeout(timeout time.Duration) *DynamicClientRegistrationDeleteOAuth2ClientParams { + var () + return &DynamicClientRegistrationDeleteOAuth2ClientParams{ + + timeout: timeout, + } +} + +// NewDynamicClientRegistrationDeleteOAuth2ClientParamsWithContext creates a new DynamicClientRegistrationDeleteOAuth2ClientParams object +// with the default values initialized, and the ability to set a context for a request +func NewDynamicClientRegistrationDeleteOAuth2ClientParamsWithContext(ctx context.Context) *DynamicClientRegistrationDeleteOAuth2ClientParams { + var () + return &DynamicClientRegistrationDeleteOAuth2ClientParams{ + + Context: ctx, + } +} + +// NewDynamicClientRegistrationDeleteOAuth2ClientParamsWithHTTPClient creates a new DynamicClientRegistrationDeleteOAuth2ClientParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDynamicClientRegistrationDeleteOAuth2ClientParamsWithHTTPClient(client *http.Client) *DynamicClientRegistrationDeleteOAuth2ClientParams { + var () + return &DynamicClientRegistrationDeleteOAuth2ClientParams{ + HTTPClient: client, + } +} + +/*DynamicClientRegistrationDeleteOAuth2ClientParams contains all the parameters to send to the API endpoint +for the dynamic client registration delete o auth2 client operation typically these are written to a http.Request +*/ +type DynamicClientRegistrationDeleteOAuth2ClientParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dynamic client registration delete o auth2 client params +func (o *DynamicClientRegistrationDeleteOAuth2ClientParams) WithTimeout(timeout time.Duration) *DynamicClientRegistrationDeleteOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dynamic client registration delete o auth2 client params +func (o *DynamicClientRegistrationDeleteOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dynamic client registration delete o auth2 client params +func (o *DynamicClientRegistrationDeleteOAuth2ClientParams) WithContext(ctx context.Context) *DynamicClientRegistrationDeleteOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dynamic client registration delete o auth2 client params +func (o *DynamicClientRegistrationDeleteOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dynamic client registration delete o auth2 client params +func (o *DynamicClientRegistrationDeleteOAuth2ClientParams) WithHTTPClient(client *http.Client) *DynamicClientRegistrationDeleteOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dynamic client registration delete o auth2 client params +func (o *DynamicClientRegistrationDeleteOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dynamic client registration delete o auth2 client params +func (o *DynamicClientRegistrationDeleteOAuth2ClientParams) WithID(id string) *DynamicClientRegistrationDeleteOAuth2ClientParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dynamic client registration delete o auth2 client params +func (o *DynamicClientRegistrationDeleteOAuth2ClientParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DynamicClientRegistrationDeleteOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/dynamic_client_registration_delete_o_auth2_client_responses.go b/internal/httpclient/client/public/dynamic_client_registration_delete_o_auth2_client_responses.go new file mode 100644 index 00000000000..868a373ad7c --- /dev/null +++ b/internal/httpclient/client/public/dynamic_client_registration_delete_o_auth2_client_responses.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// DynamicClientRegistrationDeleteOAuth2ClientReader is a Reader for the DynamicClientRegistrationDeleteOAuth2Client structure. +type DynamicClientRegistrationDeleteOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DynamicClientRegistrationDeleteOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDynamicClientRegistrationDeleteOAuth2ClientNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDynamicClientRegistrationDeleteOAuth2ClientDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDynamicClientRegistrationDeleteOAuth2ClientNoContent creates a DynamicClientRegistrationDeleteOAuth2ClientNoContent with default headers values +func NewDynamicClientRegistrationDeleteOAuth2ClientNoContent() *DynamicClientRegistrationDeleteOAuth2ClientNoContent { + return &DynamicClientRegistrationDeleteOAuth2ClientNoContent{} +} + +/*DynamicClientRegistrationDeleteOAuth2ClientNoContent handles this case with default header values. + +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +typically 201. +*/ +type DynamicClientRegistrationDeleteOAuth2ClientNoContent struct { +} + +func (o *DynamicClientRegistrationDeleteOAuth2ClientNoContent) Error() string { + return fmt.Sprintf("[DELETE /connect/register/{id}][%d] dynamicClientRegistrationDeleteOAuth2ClientNoContent ", 204) +} + +func (o *DynamicClientRegistrationDeleteOAuth2ClientNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDynamicClientRegistrationDeleteOAuth2ClientDefault creates a DynamicClientRegistrationDeleteOAuth2ClientDefault with default headers values +func NewDynamicClientRegistrationDeleteOAuth2ClientDefault(code int) *DynamicClientRegistrationDeleteOAuth2ClientDefault { + return &DynamicClientRegistrationDeleteOAuth2ClientDefault{ + _statusCode: code, + } +} + +/*DynamicClientRegistrationDeleteOAuth2ClientDefault handles this case with default header values. + +jsonError +*/ +type DynamicClientRegistrationDeleteOAuth2ClientDefault struct { + _statusCode int + + Payload *models.JSONError +} + +// Code gets the status code for the dynamic client registration delete o auth2 client default response +func (o *DynamicClientRegistrationDeleteOAuth2ClientDefault) Code() int { + return o._statusCode +} + +func (o *DynamicClientRegistrationDeleteOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[DELETE /connect/register/{id}][%d] dynamicClientRegistrationDeleteOAuth2Client default %+v", o._statusCode, o.Payload) +} + +func (o *DynamicClientRegistrationDeleteOAuth2ClientDefault) GetPayload() *models.JSONError { + return o.Payload +} + +func (o *DynamicClientRegistrationDeleteOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JSONError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/dynamic_client_registration_get_o_auth2_client_parameters.go b/internal/httpclient/client/public/dynamic_client_registration_get_o_auth2_client_parameters.go new file mode 100644 index 00000000000..ee9b1f9a3be --- /dev/null +++ b/internal/httpclient/client/public/dynamic_client_registration_get_o_auth2_client_parameters.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDynamicClientRegistrationGetOAuth2ClientParams creates a new DynamicClientRegistrationGetOAuth2ClientParams object +// with the default values initialized. +func NewDynamicClientRegistrationGetOAuth2ClientParams() *DynamicClientRegistrationGetOAuth2ClientParams { + var () + return &DynamicClientRegistrationGetOAuth2ClientParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDynamicClientRegistrationGetOAuth2ClientParamsWithTimeout creates a new DynamicClientRegistrationGetOAuth2ClientParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDynamicClientRegistrationGetOAuth2ClientParamsWithTimeout(timeout time.Duration) *DynamicClientRegistrationGetOAuth2ClientParams { + var () + return &DynamicClientRegistrationGetOAuth2ClientParams{ + + timeout: timeout, + } +} + +// NewDynamicClientRegistrationGetOAuth2ClientParamsWithContext creates a new DynamicClientRegistrationGetOAuth2ClientParams object +// with the default values initialized, and the ability to set a context for a request +func NewDynamicClientRegistrationGetOAuth2ClientParamsWithContext(ctx context.Context) *DynamicClientRegistrationGetOAuth2ClientParams { + var () + return &DynamicClientRegistrationGetOAuth2ClientParams{ + + Context: ctx, + } +} + +// NewDynamicClientRegistrationGetOAuth2ClientParamsWithHTTPClient creates a new DynamicClientRegistrationGetOAuth2ClientParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDynamicClientRegistrationGetOAuth2ClientParamsWithHTTPClient(client *http.Client) *DynamicClientRegistrationGetOAuth2ClientParams { + var () + return &DynamicClientRegistrationGetOAuth2ClientParams{ + HTTPClient: client, + } +} + +/*DynamicClientRegistrationGetOAuth2ClientParams contains all the parameters to send to the API endpoint +for the dynamic client registration get o auth2 client operation typically these are written to a http.Request +*/ +type DynamicClientRegistrationGetOAuth2ClientParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dynamic client registration get o auth2 client params +func (o *DynamicClientRegistrationGetOAuth2ClientParams) WithTimeout(timeout time.Duration) *DynamicClientRegistrationGetOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dynamic client registration get o auth2 client params +func (o *DynamicClientRegistrationGetOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dynamic client registration get o auth2 client params +func (o *DynamicClientRegistrationGetOAuth2ClientParams) WithContext(ctx context.Context) *DynamicClientRegistrationGetOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dynamic client registration get o auth2 client params +func (o *DynamicClientRegistrationGetOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dynamic client registration get o auth2 client params +func (o *DynamicClientRegistrationGetOAuth2ClientParams) WithHTTPClient(client *http.Client) *DynamicClientRegistrationGetOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dynamic client registration get o auth2 client params +func (o *DynamicClientRegistrationGetOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dynamic client registration get o auth2 client params +func (o *DynamicClientRegistrationGetOAuth2ClientParams) WithID(id string) *DynamicClientRegistrationGetOAuth2ClientParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dynamic client registration get o auth2 client params +func (o *DynamicClientRegistrationGetOAuth2ClientParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DynamicClientRegistrationGetOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/dynamic_client_registration_get_o_auth2_client_responses.go b/internal/httpclient/client/public/dynamic_client_registration_get_o_auth2_client_responses.go new file mode 100644 index 00000000000..722d08a712f --- /dev/null +++ b/internal/httpclient/client/public/dynamic_client_registration_get_o_auth2_client_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// DynamicClientRegistrationGetOAuth2ClientReader is a Reader for the DynamicClientRegistrationGetOAuth2Client structure. +type DynamicClientRegistrationGetOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DynamicClientRegistrationGetOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDynamicClientRegistrationGetOAuth2ClientOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDynamicClientRegistrationGetOAuth2ClientDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDynamicClientRegistrationGetOAuth2ClientOK creates a DynamicClientRegistrationGetOAuth2ClientOK with default headers values +func NewDynamicClientRegistrationGetOAuth2ClientOK() *DynamicClientRegistrationGetOAuth2ClientOK { + return &DynamicClientRegistrationGetOAuth2ClientOK{} +} + +/*DynamicClientRegistrationGetOAuth2ClientOK handles this case with default header values. + +oAuth2Client +*/ +type DynamicClientRegistrationGetOAuth2ClientOK struct { + Payload *models.OAuth2Client +} + +func (o *DynamicClientRegistrationGetOAuth2ClientOK) Error() string { + return fmt.Sprintf("[GET /connect/register/{id}][%d] dynamicClientRegistrationGetOAuth2ClientOK %+v", 200, o.Payload) +} + +func (o *DynamicClientRegistrationGetOAuth2ClientOK) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *DynamicClientRegistrationGetOAuth2ClientOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDynamicClientRegistrationGetOAuth2ClientDefault creates a DynamicClientRegistrationGetOAuth2ClientDefault with default headers values +func NewDynamicClientRegistrationGetOAuth2ClientDefault(code int) *DynamicClientRegistrationGetOAuth2ClientDefault { + return &DynamicClientRegistrationGetOAuth2ClientDefault{ + _statusCode: code, + } +} + +/*DynamicClientRegistrationGetOAuth2ClientDefault handles this case with default header values. + +jsonError +*/ +type DynamicClientRegistrationGetOAuth2ClientDefault struct { + _statusCode int + + Payload *models.JSONError +} + +// Code gets the status code for the dynamic client registration get o auth2 client default response +func (o *DynamicClientRegistrationGetOAuth2ClientDefault) Code() int { + return o._statusCode +} + +func (o *DynamicClientRegistrationGetOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[GET /connect/register/{id}][%d] dynamicClientRegistrationGetOAuth2Client default %+v", o._statusCode, o.Payload) +} + +func (o *DynamicClientRegistrationGetOAuth2ClientDefault) GetPayload() *models.JSONError { + return o.Payload +} + +func (o *DynamicClientRegistrationGetOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JSONError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/public/dynamic_client_registration_update_o_auth2_client_parameters.go b/internal/httpclient/client/public/dynamic_client_registration_update_o_auth2_client_parameters.go new file mode 100644 index 00000000000..6e859c8abb1 --- /dev/null +++ b/internal/httpclient/client/public/dynamic_client_registration_update_o_auth2_client_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// NewDynamicClientRegistrationUpdateOAuth2ClientParams creates a new DynamicClientRegistrationUpdateOAuth2ClientParams object +// with the default values initialized. +func NewDynamicClientRegistrationUpdateOAuth2ClientParams() *DynamicClientRegistrationUpdateOAuth2ClientParams { + var () + return &DynamicClientRegistrationUpdateOAuth2ClientParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDynamicClientRegistrationUpdateOAuth2ClientParamsWithTimeout creates a new DynamicClientRegistrationUpdateOAuth2ClientParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDynamicClientRegistrationUpdateOAuth2ClientParamsWithTimeout(timeout time.Duration) *DynamicClientRegistrationUpdateOAuth2ClientParams { + var () + return &DynamicClientRegistrationUpdateOAuth2ClientParams{ + + timeout: timeout, + } +} + +// NewDynamicClientRegistrationUpdateOAuth2ClientParamsWithContext creates a new DynamicClientRegistrationUpdateOAuth2ClientParams object +// with the default values initialized, and the ability to set a context for a request +func NewDynamicClientRegistrationUpdateOAuth2ClientParamsWithContext(ctx context.Context) *DynamicClientRegistrationUpdateOAuth2ClientParams { + var () + return &DynamicClientRegistrationUpdateOAuth2ClientParams{ + + Context: ctx, + } +} + +// NewDynamicClientRegistrationUpdateOAuth2ClientParamsWithHTTPClient creates a new DynamicClientRegistrationUpdateOAuth2ClientParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDynamicClientRegistrationUpdateOAuth2ClientParamsWithHTTPClient(client *http.Client) *DynamicClientRegistrationUpdateOAuth2ClientParams { + var () + return &DynamicClientRegistrationUpdateOAuth2ClientParams{ + HTTPClient: client, + } +} + +/*DynamicClientRegistrationUpdateOAuth2ClientParams contains all the parameters to send to the API endpoint +for the dynamic client registration update o auth2 client operation typically these are written to a http.Request +*/ +type DynamicClientRegistrationUpdateOAuth2ClientParams struct { + + /*Body*/ + Body *models.OAuth2Client + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dynamic client registration update o auth2 client params +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) WithTimeout(timeout time.Duration) *DynamicClientRegistrationUpdateOAuth2ClientParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dynamic client registration update o auth2 client params +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dynamic client registration update o auth2 client params +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) WithContext(ctx context.Context) *DynamicClientRegistrationUpdateOAuth2ClientParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dynamic client registration update o auth2 client params +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dynamic client registration update o auth2 client params +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) WithHTTPClient(client *http.Client) *DynamicClientRegistrationUpdateOAuth2ClientParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dynamic client registration update o auth2 client params +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the dynamic client registration update o auth2 client params +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) WithBody(body *models.OAuth2Client) *DynamicClientRegistrationUpdateOAuth2ClientParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the dynamic client registration update o auth2 client params +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) SetBody(body *models.OAuth2Client) { + o.Body = body +} + +// WithID adds the id to the dynamic client registration update o auth2 client params +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) WithID(id string) *DynamicClientRegistrationUpdateOAuth2ClientParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dynamic client registration update o auth2 client params +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DynamicClientRegistrationUpdateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/public/dynamic_client_registration_update_o_auth2_client_responses.go b/internal/httpclient/client/public/dynamic_client_registration_update_o_auth2_client_responses.go new file mode 100644 index 00000000000..59d824b484f --- /dev/null +++ b/internal/httpclient/client/public/dynamic_client_registration_update_o_auth2_client_responses.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package public + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/hydra/internal/httpclient/models" +) + +// DynamicClientRegistrationUpdateOAuth2ClientReader is a Reader for the DynamicClientRegistrationUpdateOAuth2Client structure. +type DynamicClientRegistrationUpdateOAuth2ClientReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DynamicClientRegistrationUpdateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDynamicClientRegistrationUpdateOAuth2ClientOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDynamicClientRegistrationUpdateOAuth2ClientDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDynamicClientRegistrationUpdateOAuth2ClientOK creates a DynamicClientRegistrationUpdateOAuth2ClientOK with default headers values +func NewDynamicClientRegistrationUpdateOAuth2ClientOK() *DynamicClientRegistrationUpdateOAuth2ClientOK { + return &DynamicClientRegistrationUpdateOAuth2ClientOK{} +} + +/*DynamicClientRegistrationUpdateOAuth2ClientOK handles this case with default header values. + +oAuth2Client +*/ +type DynamicClientRegistrationUpdateOAuth2ClientOK struct { + Payload *models.OAuth2Client +} + +func (o *DynamicClientRegistrationUpdateOAuth2ClientOK) Error() string { + return fmt.Sprintf("[PUT /connect/register/{id}][%d] dynamicClientRegistrationUpdateOAuth2ClientOK %+v", 200, o.Payload) +} + +func (o *DynamicClientRegistrationUpdateOAuth2ClientOK) GetPayload() *models.OAuth2Client { + return o.Payload +} + +func (o *DynamicClientRegistrationUpdateOAuth2ClientOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.OAuth2Client) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDynamicClientRegistrationUpdateOAuth2ClientDefault creates a DynamicClientRegistrationUpdateOAuth2ClientDefault with default headers values +func NewDynamicClientRegistrationUpdateOAuth2ClientDefault(code int) *DynamicClientRegistrationUpdateOAuth2ClientDefault { + return &DynamicClientRegistrationUpdateOAuth2ClientDefault{ + _statusCode: code, + } +} + +/*DynamicClientRegistrationUpdateOAuth2ClientDefault handles this case with default header values. + +jsonError +*/ +type DynamicClientRegistrationUpdateOAuth2ClientDefault struct { + _statusCode int + + Payload *models.JSONError +} + +// Code gets the status code for the dynamic client registration update o auth2 client default response +func (o *DynamicClientRegistrationUpdateOAuth2ClientDefault) Code() int { + return o._statusCode +} + +func (o *DynamicClientRegistrationUpdateOAuth2ClientDefault) Error() string { + return fmt.Sprintf("[PUT /connect/register/{id}][%d] dynamicClientRegistrationUpdateOAuth2Client default %+v", o._statusCode, o.Payload) +} + +func (o *DynamicClientRegistrationUpdateOAuth2ClientDefault) GetPayload() *models.JSONError { + return o.Payload +} + +func (o *DynamicClientRegistrationUpdateOAuth2ClientDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.JSONError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} From 98ded330de191340f32a8f725b832e636e74aae6 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 3 Jan 2022 19:27:29 +0200 Subject: [PATCH 38/41] u --- client/doc.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/doc.go b/client/doc.go index fa68f7f3ef8..87bdb3356ec 100644 --- a/client/doc.go +++ b/client/doc.go @@ -38,6 +38,8 @@ type dynamicClientRegistrationCreateOAuth2Client struct { // swagger:parameters updateOAuth2Client type swaggerUpdateClientPayload struct { + // The id of the OAuth 2.0 Client. + // // in: path // required: true ID string `json:"id"` @@ -49,6 +51,8 @@ type swaggerUpdateClientPayload struct { // swagger:parameters dynamicClientRegistrationUpdateOAuth2Client type dynamicClientRegistrationUpdateOAuth2Client struct { + // The id of the OAuth 2.0 Client. + // // in: path // required: true ID string `json:"id"` @@ -60,6 +64,8 @@ type dynamicClientRegistrationUpdateOAuth2Client struct { // swagger:parameters patchOAuth2Client type swaggerPatchClientPayload struct { + // The id of the OAuth 2.0 Client. + // // in: path // required: true ID string `json:"id"` @@ -110,11 +116,14 @@ type swaggerGetOAuth2Client struct { // The id of the OAuth 2.0 Client. // // in: path + // required: true ID string `json:"id"` } // swagger:parameters dynamicClientRegistrationGetOAuth2Client type dynamicClientRegistrationGetOAuth2Client struct { + // The id of the OAuth 2.0 Client. + // // in: path // required: true ID string `json:"id"` @@ -125,11 +134,14 @@ type swaggerDeleteOAuth2Client struct { // The id of the OAuth 2.0 Client. // // in: path + // required: true ID string `json:"id"` } // swagger:parameters dynamicClientRegistrationDeleteOAuth2Client type dynamicClientRegistrationDeleteOAuth2Client struct { + // The id of the OAuth 2.0 Client. + // // in: path // required: true ID string `json:"id"` From 87e0649d948df2fc5bd9829ba6f27fe9e1169513 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 3 Jan 2022 19:27:54 +0200 Subject: [PATCH 39/41] u --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e8026f915ec..2fb42655fb9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - goreleaser: ory/goreleaser@0.1.36 + goreleaser: ory/goreleaser@0.1.37 slack: circleci/slack@3.4.2 sdk: ory/sdk@0.1.52 changelog: ory/changelog@0.1.10 From 673302384cfa3453c7b99fa1fa86127391f71ebf Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 3 Jan 2022 20:12:32 +0200 Subject: [PATCH 40/41] u --- spec/api.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/api.json b/spec/api.json index f6a41970f08..e36be9d646e 100755 --- a/spec/api.json +++ b/spec/api.json @@ -258,6 +258,7 @@ "parameters": [ { "type": "string", + "description": "The id of the OAuth 2.0 Client.", "name": "id", "in": "path", "required": true @@ -344,6 +345,7 @@ "parameters": [ { "type": "string", + "description": "The id of the OAuth 2.0 Client.", "name": "id", "in": "path", "required": true @@ -438,6 +440,7 @@ "parameters": [ { "type": "string", + "description": "The id of the OAuth 2.0 Client.", "name": "id", "in": "path", "required": true @@ -478,6 +481,7 @@ "parameters": [ { "type": "string", + "description": "The id of the OAuth 2.0 Client.", "name": "id", "in": "path", "required": true @@ -523,6 +527,7 @@ "parameters": [ { "type": "string", + "description": "The id of the OAuth 2.0 Client.", "name": "id", "in": "path", "required": true @@ -2858,7 +2863,7 @@ } }, "Scope": { - "description": "The level at which the volume exists. Either `global` for cluster-wide,\nor `local` for machine level.", + "description": "The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level.", "type": "string" }, "Status": { From 489985f50a2ffd1e46be0a9c4bdbe0a6ab9d3931 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Tue, 4 Jan 2022 10:41:49 +0200 Subject: [PATCH 41/41] u --- client/sdk_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/sdk_test.go b/client/sdk_test.go index ec90f69325c..1c8760fa276 100644 --- a/client/sdk_test.go +++ b/client/sdk_test.go @@ -115,6 +115,11 @@ func TestClientSDK(t *testing.T) { result.Payload.UpdatedAt = strfmt.DateTime{} assert.NotEmpty(t, result.Payload.CreatedAt) result.Payload.CreatedAt = strfmt.DateTime{} + assert.NotEmpty(t, result.Payload.RegistrationAccessToken) + assert.NotEmpty(t, result.Payload.RegistrationClientURI) + result.Payload.RegistrationAccessToken = "" + result.Payload.RegistrationClientURI = "" + assert.EqualValues(t, compareClient, result.Payload) assert.EqualValues(t, "bar", result.Payload.Metadata.(map[string]interface{})["foo"])