From f9e3e1de5c67e6722838593a33f2b6f4d02e656c Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Mon, 5 Oct 2020 10:43:37 +0200 Subject: [PATCH] chore: regenerate sdk and format --- .schema/api.swagger.json | 42 ++++---- docs/docs/contributing.md | 48 +++++---- ...in_flow_with_password_method_parameters.go | 101 +++--------------- ...service_login_flow_with_password_method.go | 49 +++++++++ 4 files changed, 113 insertions(+), 127 deletions(-) create mode 100644 internal/httpclient/models/complete_self_service_login_flow_with_password_method.go diff --git a/.schema/api.swagger.json b/.schema/api.swagger.json index 8e78ef46861..bdfee73f539 100755 --- a/.schema/api.swagger.json +++ b/.schema/api.swagger.json @@ -702,30 +702,19 @@ "summary": "Complete Login Flow with Username/Email Password Method", "operationId": "completeSelfServiceLoginFlowWithPasswordMethod", "parameters": [ - { - "type": "string", - "description": "The user's password.", - "name": "password", - "in": "query" - }, - { - "type": "string", - "description": "Identifier is the email or username of the user trying to log in.", - "name": "identifier", - "in": "query" - }, - { - "type": "string", - "description": "Sending the anti-csrf token is only required for browser login flows.", - "name": "csrf_token", - "in": "query" - }, { "type": "string", "description": "The Flow ID", "name": "flow", "in": "query", "required": true + }, + { + "name": "Body", + "in": "body", + "schema": { + "$ref": "#/definitions/CompleteSelfServiceLoginFlowWithPasswordMethod" + } } ], "responses": { @@ -1668,6 +1657,23 @@ } }, "definitions": { + "CompleteSelfServiceLoginFlowWithPasswordMethod": { + "type": "object", + "properties": { + "csrf_token": { + "description": "Sending the anti-csrf token is only required for browser login flows.", + "type": "string" + }, + "identifier": { + "description": "Identifier is the email or username of the user trying to log in.", + "type": "string" + }, + "password": { + "description": "The user's password.", + "type": "string" + } + } + }, "CompleteSelfServiceSettingsFlowWithPasswordMethod": { "type": "object", "required": [ diff --git a/docs/docs/contributing.md b/docs/docs/contributing.md index 925fc2fc786..05704e529aa 100644 --- a/docs/docs/contributing.md +++ b/docs/docs/contributing.md @@ -86,7 +86,8 @@ Please follow these guidelines when formatting source code: Please provide documentation when changing, removing, or adding features. Documentation resides in the project's `docs` folder. -In cases where a project does not have a `docs` folder check the README for instructions. +In cases where a project does not have a `docs` folder check the README for +instructions. The commands listed below work exclusively for projects with a `docs` folder @@ -108,8 +109,8 @@ To start a local development server with hot reloading, run: $ npm start ``` -This command opens up a browser window. Please note that changes to the sidebar are not hot-reloaded -and require a restart of the command. +This command opens up a browser window. Please note that changes to the sidebar +are not hot-reloaded and require a restart of the command. #### Build @@ -146,27 +147,32 @@ please include a note in your commit message explaining why. ## How We Organize Our Work -All repositories in the [ORY organization](https://github.com/ory) have their issues and pull requests -monitored in the [ORY Monitoring Board](https://github.com/orgs/ory/projects/9). This allows -for a transparent backlog of unanswered issues and pull requests across the ecosystem from those -who are allowed to merge pull requests to the main branch. +All repositories in the [ORY organization](https://github.com/ory) have their +issues and pull requests monitored in the +[ORY Monitoring Board](https://github.com/orgs/ory/projects/9). This allows for +a transparent backlog of unanswered issues and pull requests across the +ecosystem from those who are allowed to merge pull requests to the main branch. The process is as follows: -1. _Cards_ represent open issues and pull requests and are automatically assigned to the **Triage** column if - the author is not one of the maintainers and no maintainer has answered yet. -2. A maintainer assigns the issue or pull request to someone or adds the label _help wanted_ - which moves the card to **Requires Action**. -3. If a maintainer leaves a comment or review, the card moves to **Pending Reply**, implying that - the original author needs to do something (e.g. implement a change, explain something in more detail, ...). -4. If a non-maintainer pushes changes to the pull request or leaves a comment, the card moves - back to **Requires Action**. -5. If a card stays inactive for 60 days or more days, we assume that public interest in the issue - or change has waned, **archiving** the card. -6. If the issue is closed or the pull request merged or closed, the card is **archived** as well. - -We try our best to answer all issues and review all pull requests and hope that this transparent way -of keeping a backlog helps you better understand how heavy the workload is. +1. _Cards_ represent open issues and pull requests and are automatically + assigned to the **Triage** column if the author is not one of the maintainers + and no maintainer has answered yet. +2. A maintainer assigns the issue or pull request to someone or adds the label + _help wanted_ which moves the card to **Requires Action**. +3. If a maintainer leaves a comment or review, the card moves to **Pending + Reply**, implying that the original author needs to do something (e.g. + implement a change, explain something in more detail, ...). +4. If a non-maintainer pushes changes to the pull request or leaves a comment, + the card moves back to **Requires Action**. +5. If a card stays inactive for 60 days or more days, we assume that public + interest in the issue or change has waned, **archiving** the card. +6. If the issue is closed or the pull request merged or closed, the card is + **archived** as well. + +We try our best to answer all issues and review all pull requests and hope that +this transparent way of keeping a backlog helps you better understand how heavy +the workload is. ## Communication diff --git a/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_parameters.go b/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_parameters.go index 5e13742bb5b..fcf15efead4 100644 --- a/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_parameters.go +++ b/internal/httpclient/client/public/complete_self_service_login_flow_with_password_method_parameters.go @@ -14,6 +14,8 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + + "github.com/ory/kratos/internal/httpclient/models" ) // NewCompleteSelfServiceLoginFlowWithPasswordMethodParams creates a new CompleteSelfServiceLoginFlowWithPasswordMethodParams object @@ -60,26 +62,13 @@ for the complete self service login flow with password method operation typicall */ type CompleteSelfServiceLoginFlowWithPasswordMethodParams struct { - /*CsrfToken - Sending the anti-csrf token is only required for browser login flows. - - */ - CsrfToken *string + /*Body*/ + Body *models.CompleteSelfServiceLoginFlowWithPasswordMethod /*Flow The Flow ID */ Flow string - /*Identifier - Identifier is the email or username of the user trying to log in. - - */ - Identifier *string - /*Password - The user's password. - - */ - Password *string timeout time.Duration Context context.Context @@ -119,15 +108,15 @@ func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) SetHTTPClient(cli o.HTTPClient = client } -// WithCsrfToken adds the csrfToken to the complete self service login flow with password method params -func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WithCsrfToken(csrfToken *string) *CompleteSelfServiceLoginFlowWithPasswordMethodParams { - o.SetCsrfToken(csrfToken) +// WithBody adds the body to the complete self service login flow with password method params +func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WithBody(body *models.CompleteSelfServiceLoginFlowWithPasswordMethod) *CompleteSelfServiceLoginFlowWithPasswordMethodParams { + o.SetBody(body) return o } -// SetCsrfToken adds the csrfToken to the complete self service login flow with password method params -func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) SetCsrfToken(csrfToken *string) { - o.CsrfToken = csrfToken +// SetBody adds the body to the complete self service login flow with password method params +func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) SetBody(body *models.CompleteSelfServiceLoginFlowWithPasswordMethod) { + o.Body = body } // WithFlow adds the flow to the complete self service login flow with password method params @@ -141,28 +130,6 @@ func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) SetFlow(flow stri o.Flow = flow } -// WithIdentifier adds the identifier to the complete self service login flow with password method params -func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WithIdentifier(identifier *string) *CompleteSelfServiceLoginFlowWithPasswordMethodParams { - o.SetIdentifier(identifier) - return o -} - -// SetIdentifier adds the identifier to the complete self service login flow with password method params -func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) SetIdentifier(identifier *string) { - o.Identifier = identifier -} - -// WithPassword adds the password to the complete self service login flow with password method params -func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WithPassword(password *string) *CompleteSelfServiceLoginFlowWithPasswordMethodParams { - o.SetPassword(password) - return o -} - -// SetPassword adds the password to the complete self service login flow with password method params -func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) SetPassword(password *string) { - o.Password = password -} - // WriteToRequest writes these params to a swagger request func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -171,20 +138,10 @@ func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WriteToRequest(r } var res []error - if o.CsrfToken != nil { - - // query param csrf_token - var qrCsrfToken string - if o.CsrfToken != nil { - qrCsrfToken = *o.CsrfToken - } - qCsrfToken := qrCsrfToken - if qCsrfToken != "" { - if err := r.SetQueryParam("csrf_token", qCsrfToken); err != nil { - return err - } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err } - } // query param flow @@ -196,38 +153,6 @@ func (o *CompleteSelfServiceLoginFlowWithPasswordMethodParams) WriteToRequest(r } } - if o.Identifier != nil { - - // query param identifier - var qrIdentifier string - if o.Identifier != nil { - qrIdentifier = *o.Identifier - } - qIdentifier := qrIdentifier - if qIdentifier != "" { - if err := r.SetQueryParam("identifier", qIdentifier); err != nil { - return err - } - } - - } - - if o.Password != nil { - - // query param password - var qrPassword string - if o.Password != nil { - qrPassword = *o.Password - } - qPassword := qrPassword - if qPassword != "" { - if err := r.SetQueryParam("password", qPassword); err != nil { - return err - } - } - - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/internal/httpclient/models/complete_self_service_login_flow_with_password_method.go b/internal/httpclient/models/complete_self_service_login_flow_with_password_method.go new file mode 100644 index 00000000000..dd39976150c --- /dev/null +++ b/internal/httpclient/models/complete_self_service_login_flow_with_password_method.go @@ -0,0 +1,49 @@ +// 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/strfmt" + "github.com/go-openapi/swag" +) + +// CompleteSelfServiceLoginFlowWithPasswordMethod complete self service login flow with password method +// +// swagger:model CompleteSelfServiceLoginFlowWithPasswordMethod +type CompleteSelfServiceLoginFlowWithPasswordMethod struct { + + // Sending the anti-csrf token is only required for browser login flows. + CsrfToken string `json:"csrf_token,omitempty"` + + // Identifier is the email or username of the user trying to log in. + Identifier string `json:"identifier,omitempty"` + + // The user's password. + Password string `json:"password,omitempty"` +} + +// Validate validates this complete self service login flow with password method +func (m *CompleteSelfServiceLoginFlowWithPasswordMethod) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CompleteSelfServiceLoginFlowWithPasswordMethod) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CompleteSelfServiceLoginFlowWithPasswordMethod) UnmarshalBinary(b []byte) error { + var res CompleteSelfServiceLoginFlowWithPasswordMethod + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}