Skip to content

chore(sdk): update order of arguments #2840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions internal/httpclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1109,19 +1109,6 @@ paths:
More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).
operationId: initializeSelfServiceLoginFlowForBrowsers
parameters:
- description: |-
An optional Hydra login challenge. If present, Kratos will cooperate with
Ory Hydra to act as an OAuth2 identity provider.

The value for this parameter comes from `login_challenge` URL Query parameter sent to your
application (e.g. `/login?login_challenge=abcde`).
explode: true
in: query
name: login_challenge
required: false
schema:
type: string
style: form
- description: |-
Refresh a login session

Expand Down Expand Up @@ -1169,6 +1156,19 @@ paths:
schema:
type: string
style: simple
- description: |-
An optional Hydra login challenge. If present, Kratos will cooperate with
Ory Hydra to act as an OAuth2 identity provider.

The value for this parameter comes from `login_challenge` URL Query parameter sent to your
application (e.g. `/login?login_challenge=abcde`).
explode: true
in: query
name: login_challenge
required: false
schema:
type: string
style: form
responses:
"200":
content:
Expand Down Expand Up @@ -1868,6 +1868,14 @@ paths:
More information can be found at [Ory Kratos User Login](https://www.ory.sh/docs/kratos/self-service/flows/user-login) and [User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration).
operationId: initializeSelfServiceRegistrationFlowForBrowsers
parameters:
- description: The URL to return the browser to after the flow was completed.
explode: true
in: query
name: return_to
required: false
schema:
type: string
style: form
- description: |-
Ory OAuth 2.0 Login Challenge.

Expand All @@ -1884,14 +1892,6 @@ paths:
schema:
type: string
style: form
- description: The URL to return the browser to after the flow was completed.
explode: true
in: query
name: return_to
required: false
schema:
type: string
style: form
responses:
"200":
content:
Expand Down
32 changes: 16 additions & 16 deletions internal/httpclient/api_v0alpha2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions internal/httpclient/docs/V0alpha2Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ No authorization required

## InitializeSelfServiceLoginFlowForBrowsers

> SelfServiceLoginFlow InitializeSelfServiceLoginFlowForBrowsers(ctx).LoginChallenge(loginChallenge).Refresh(refresh).Aal(aal).ReturnTo(returnTo).Cookie(cookie).Execute()
> SelfServiceLoginFlow InitializeSelfServiceLoginFlowForBrowsers(ctx).Refresh(refresh).Aal(aal).ReturnTo(returnTo).Cookie(cookie).LoginChallenge(loginChallenge).Execute()

Initialize Login Flow for Browsers

Expand All @@ -1512,15 +1512,15 @@ import (
)

func main() {
loginChallenge := "loginChallenge_example" // string | An optional Hydra login challenge. If present, Kratos will cooperate with Ory Hydra to act as an OAuth2 identity provider. The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/login?login_challenge=abcde`). (optional)
refresh := true // bool | Refresh a login session If set to true, this will refresh an existing login session by asking the user to sign in again. This will reset the authenticated_at time of the session. (optional)
aal := "aal_example" // string | Request a Specific AuthenticationMethod Assurance Level Use this parameter to upgrade an existing session's authenticator assurance level (AAL). This allows you to ask for multi-factor authentication. When an identity sign in using e.g. username+password, the AAL is 1. If you wish to \"upgrade\" the session's security by asking the user to perform TOTP / WebAuth/ ... you would set this to \"aal2\". (optional)
returnTo := "returnTo_example" // string | The URL to return the browser to after the flow was completed. (optional)
cookie := "cookie_example" // string | HTTP Cookies When using the SDK in a browser app, on the server side you must include the HTTP Cookie Header sent by the client to your server here. This ensures that CSRF and session cookies are respected. (optional)
loginChallenge := "loginChallenge_example" // string | An optional Hydra login challenge. If present, Kratos will cooperate with Ory Hydra to act as an OAuth2 identity provider. The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/login?login_challenge=abcde`). (optional)

configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.V0alpha2Api.InitializeSelfServiceLoginFlowForBrowsers(context.Background()).LoginChallenge(loginChallenge).Refresh(refresh).Aal(aal).ReturnTo(returnTo).Cookie(cookie).Execute()
resp, r, err := apiClient.V0alpha2Api.InitializeSelfServiceLoginFlowForBrowsers(context.Background()).Refresh(refresh).Aal(aal).ReturnTo(returnTo).Cookie(cookie).LoginChallenge(loginChallenge).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `V0alpha2Api.InitializeSelfServiceLoginFlowForBrowsers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
Expand All @@ -1541,11 +1541,11 @@ Other parameters are passed through a pointer to a apiInitializeSelfServiceLogin

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**loginChallenge** | **string** | An optional Hydra login challenge. If present, Kratos will cooperate with Ory Hydra to act as an OAuth2 identity provider. The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/login?login_challenge=abcde`). |
**refresh** | **bool** | Refresh a login session If set to true, this will refresh an existing login session by asking the user to sign in again. This will reset the authenticated_at time of the session. |
**aal** | **string** | Request a Specific AuthenticationMethod Assurance Level Use this parameter to upgrade an existing session's authenticator assurance level (AAL). This allows you to ask for multi-factor authentication. When an identity sign in using e.g. username+password, the AAL is 1. If you wish to \"upgrade\" the session's security by asking the user to perform TOTP / WebAuth/ ... you would set this to \"aal2\". |
**returnTo** | **string** | The URL to return the browser to after the flow was completed. |
**cookie** | **string** | HTTP Cookies When using the SDK in a browser app, on the server side you must include the HTTP Cookie Header sent by the client to your server here. This ensures that CSRF and session cookies are respected. |
**loginChallenge** | **string** | An optional Hydra login challenge. If present, Kratos will cooperate with Ory Hydra to act as an OAuth2 identity provider. The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/login?login_challenge=abcde`). |

### Return type

Expand Down Expand Up @@ -1764,7 +1764,7 @@ No authorization required

## InitializeSelfServiceRegistrationFlowForBrowsers

> SelfServiceRegistrationFlow InitializeSelfServiceRegistrationFlowForBrowsers(ctx).LoginChallenge(loginChallenge).ReturnTo(returnTo).Execute()
> SelfServiceRegistrationFlow InitializeSelfServiceRegistrationFlowForBrowsers(ctx).ReturnTo(returnTo).LoginChallenge(loginChallenge).Execute()

Initialize Registration Flow for Browsers

Expand All @@ -1783,12 +1783,12 @@ import (
)

func main() {
loginChallenge := "loginChallenge_example" // string | Ory OAuth 2.0 Login Challenge. If set will cooperate with Ory OAuth2 and OpenID to act as an OAuth2 server / OpenID Provider. The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/registration?login_challenge=abcde`). This feature is compatible with Ory Hydra when not running on the Ory Network. (optional)
returnTo := "returnTo_example" // string | The URL to return the browser to after the flow was completed. (optional)
loginChallenge := "loginChallenge_example" // string | Ory OAuth 2.0 Login Challenge. If set will cooperate with Ory OAuth2 and OpenID to act as an OAuth2 server / OpenID Provider. The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/registration?login_challenge=abcde`). This feature is compatible with Ory Hydra when not running on the Ory Network. (optional)

configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.V0alpha2Api.InitializeSelfServiceRegistrationFlowForBrowsers(context.Background()).LoginChallenge(loginChallenge).ReturnTo(returnTo).Execute()
resp, r, err := apiClient.V0alpha2Api.InitializeSelfServiceRegistrationFlowForBrowsers(context.Background()).ReturnTo(returnTo).LoginChallenge(loginChallenge).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `V0alpha2Api.InitializeSelfServiceRegistrationFlowForBrowsers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
Expand All @@ -1809,8 +1809,8 @@ Other parameters are passed through a pointer to a apiInitializeSelfServiceRegis

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**loginChallenge** | **string** | Ory OAuth 2.0 Login Challenge. If set will cooperate with Ory OAuth2 and OpenID to act as an OAuth2 server / OpenID Provider. The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/registration?login_challenge=abcde`). This feature is compatible with Ory Hydra when not running on the Ory Network. |
**returnTo** | **string** | The URL to return the browser to after the flow was completed. |
**loginChallenge** | **string** | Ory OAuth 2.0 Login Challenge. If set will cooperate with Ory OAuth2 and OpenID to act as an OAuth2 server / OpenID Provider. The value for this parameter comes from `login_challenge` URL Query parameter sent to your application (e.g. `/registration?login_challenge=abcde`). This feature is compatible with Ory Hydra when not running on the Ory Network. |

### Return type

Expand Down
20 changes: 10 additions & 10 deletions selfservice/flow/login/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,6 @@ func (h *Handler) initAPIFlow(w http.ResponseWriter, r *http.Request, _ httprout
// nolint:deadcode,unused
// swagger:parameters initializeSelfServiceLoginFlowForBrowsers
type initializeSelfServiceLoginFlowForBrowsers struct {
// An optional Hydra login challenge. If present, Kratos will cooperate with
// Ory Hydra to act as an OAuth2 identity provider.
//
// The value for this parameter comes from `login_challenge` URL Query parameter sent to your
// application (e.g. `/login?login_challenge=abcde`).
//
// required: false
// in: query
HydraLoginChallenge string `json:"login_challenge"`

// Refresh a login session
//
// If set to true, this will refresh an existing login session by
Expand Down Expand Up @@ -326,6 +316,16 @@ type initializeSelfServiceLoginFlowForBrowsers struct {
// in: header
// name: Cookie
Cookies string `json:"Cookie"`

// An optional Hydra login challenge. If present, Kratos will cooperate with
// Ory Hydra to act as an OAuth2 identity provider.
//
// The value for this parameter comes from `login_challenge` URL Query parameter sent to your
// application (e.g. `/login?login_challenge=abcde`).
//
// required: false
// in: query
HydraLoginChallenge string `json:"login_challenge"`
}

// swagger:route GET /self-service/login/browser v0alpha2 initializeSelfServiceLoginFlowForBrowsers
Expand Down
10 changes: 5 additions & 5 deletions selfservice/flow/registration/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ func (h *Handler) initApiFlow(w http.ResponseWriter, r *http.Request, _ httprout
// nolint:deadcode,unused
// swagger:parameters initializeSelfServiceRegistrationFlowForBrowsers
type initializeSelfServiceRegistrationFlowForBrowsers struct {
// The URL to return the browser to after the flow was completed.
//
// in: query
ReturnTo string `json:"return_to"`

// Ory OAuth 2.0 Login Challenge.
//
// If set will cooperate with Ory OAuth2 and OpenID to act as an OAuth2 server / OpenID Provider.
Expand All @@ -207,11 +212,6 @@ type initializeSelfServiceRegistrationFlowForBrowsers struct {
// required: false
// in: query
LoginChallenge string `json:"login_challenge"`

// The URL to return the browser to after the flow was completed.
//
// in: query
ReturnTo string `json:"return_to"`
}

// swagger:route GET /self-service/registration/browser v0alpha2 initializeSelfServiceRegistrationFlowForBrowsers
Expand Down
Loading