From 6619562667ef0e363d14c57cfbcd15c16f292853 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Sun, 27 Sep 2020 14:48:31 +0200 Subject: [PATCH] refactor: remove common keyword from API spec BREAKING CHANGE: The "common" keyword has been removed from the Swagger 2.0 spec which deprecates the `common` module / package / class (depending on the generated SDK). Please use `public` or `admin` instead! Additionally, the SDK for TypeScript now uses the `fetch` API which allows the SDK to be used in both client-side as well as server-side contexts. Please note that several methods and parameters in the generated TypeScript SDK have changed. Please check the TypeScript results to see what needs to be changed! --- .schema/api.swagger.json | 12 +- docs/docs/reference/api.mdx | 2268 ++++++++--------- docs/docs/reference/configuration.md | 146 +- .../flows/code/login/samples/get.go.txt | 6 +- .../flows/code/recovery/samples/get.go.txt | 4 +- .../flows/code/settings/samples/get.go.txt | 2 +- .../code/verification/samples/get.go.txt | 6 +- .../httpclient/client/common/common_client.go | 323 --- .../httpclient/client/ory_kratos_client.go | 5 - .../get_schema_parameters.go | 2 +- .../get_schema_responses.go | 2 +- .../get_self_service_error_parameters.go | 2 +- .../get_self_service_error_responses.go | 2 +- .../get_self_service_login_flow_parameters.go | 2 +- .../get_self_service_login_flow_responses.go | 2 +- ...t_self_service_recovery_flow_parameters.go | 2 +- ...et_self_service_recovery_flow_responses.go | 2 +- ...lf_service_registration_flow_parameters.go | 2 +- ...elf_service_registration_flow_responses.go | 2 +- ...t_self_service_settings_flow_parameters.go | 2 +- ...et_self_service_settings_flow_responses.go | 2 +- ...lf_service_verification_flow_parameters.go | 2 +- ...elf_service_verification_flow_responses.go | 2 +- .../httpclient/client/public/public_client.go | 284 +++ internal/testhelpers/selfservice_login.go | 7 +- internal/testhelpers/selfservice_recovery.go | 19 +- .../testhelpers/selfservice_registration.go | 7 +- internal/testhelpers/selfservice_settings.go | 9 +- .../testhelpers/selfservice_verification.go | 19 +- schema/handler.go | 2 +- selfservice/flow/login/error_test.go | 6 +- selfservice/flow/login/handler.go | 2 +- selfservice/flow/recovery/error_test.go | 6 +- selfservice/flow/recovery/handler.go | 2 +- selfservice/flow/registration/error_test.go | 6 +- selfservice/flow/registration/handler.go | 2 +- selfservice/flow/settings/error_test.go | 6 +- selfservice/flow/settings/handler.go | 2 +- selfservice/flow/settings/handler_test.go | 42 +- selfservice/flow/verification/handler.go | 2 +- .../strategy/link/strategy_recovery_test.go | 14 +- .../link/strategy_verification_test.go | 10 +- .../strategy/oidc/strategy_settings_test.go | 16 +- selfservice/strategy/profile/strategy_test.go | 5 +- 44 files changed, 1576 insertions(+), 1692 deletions(-) delete mode 100644 internal/httpclient/client/common/common_client.go rename internal/httpclient/client/{common => public}/get_schema_parameters.go (99%) rename internal/httpclient/client/{common => public}/get_schema_responses.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_error_parameters.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_error_responses.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_login_flow_parameters.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_login_flow_responses.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_recovery_flow_parameters.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_recovery_flow_responses.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_registration_flow_parameters.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_registration_flow_responses.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_settings_flow_parameters.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_settings_flow_responses.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_verification_flow_parameters.go (99%) rename internal/httpclient/client/{common => public}/get_self_service_verification_flow_responses.go (99%) diff --git a/.schema/api.swagger.json b/.schema/api.swagger.json index af2acdce024..225f2a6e6d3 100755 --- a/.schema/api.swagger.json +++ b/.schema/api.swagger.json @@ -402,9 +402,7 @@ "https" ], "tags": [ - "common", - "public", - "admin" + "public" ], "operationId": "getSchema", "parameters": [ @@ -494,7 +492,7 @@ }, "/self-service/errors": { "get": { - "description": "This endpoint returns the error associated with a user-facing self service errors.\n\nWhen accessing this endpoint through ORY Kratos' Public API, ensure that cookies are set as they are required for CSRF to work. To prevent\ntoken scanning attacks, the public endpoint does not return 404 status codes.\n\nThis endpoint supports stub values to help you implement the error UI:\n\n`?error=stub:500` - returns a stub 500 (Internal Server Error) error.\n\nMore information can be found at [ORY Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).", + "description": "This endpoint returns the error associated with a user-facing self service errors.\n\nThis endpoint supports stub values to help you implement the error UI:\n\n`?error=stub:500` - returns a stub 500 (Internal Server Error) error.\n\nMore information can be found at [ORY Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).", "produces": [ "application/json" ], @@ -503,7 +501,6 @@ "https" ], "tags": [ - "common", "public", "admin" ], @@ -624,7 +621,6 @@ "https" ], "tags": [ - "common", "public", "admin" ], @@ -814,7 +810,6 @@ "https" ], "tags": [ - "common", "public", "admin" ], @@ -986,7 +981,6 @@ "https" ], "tags": [ - "common", "public", "admin" ], @@ -1165,7 +1159,6 @@ "https" ], "tags": [ - "common", "public", "admin" ], @@ -1411,7 +1404,6 @@ "https" ], "tags": [ - "common", "public", "admin" ], diff --git a/docs/docs/reference/api.mdx b/docs/docs/reference/api.mdx index 33708fead91..f8a935b4fca 100644 --- a/docs/docs/reference/api.mdx +++ b/docs/docs/reference/api.mdx @@ -3,8 +3,6 @@ title: REST API id: api --- - - Welcome to the ORY Kratos HTTP API documentation! import Tabs from '@theme/Tabs' @@ -12,21 +10,24 @@ import TabItem from '@theme/TabItem' :::info -You are viewing REST API documentation. This documentation is auto-generated from a swagger specification which -itself is generated from annotations in the source code of the project. It is possible that this documentation includes -bugs and that code samples are incomplete or wrong. +You are viewing REST API documentation. This documentation is auto-generated +from a swagger specification which itself is generated from annotations in the +source code of the project. It is possible that this documentation includes bugs +and that code samples are incomplete or wrong. If you find issues in the respective documentation, please do not edit the -Markdown files directly (as they are generated) but raise an issue on the project's GitHub presence instead. This documentation -will improve over time with your help! If you have ideas how to improve this part of the documentation, feel free to -share them in a [GitHub issue](https://github.com/ory/docs/issues/new) any time. +Markdown files directly (as they are generated) but raise an issue on the +project's GitHub presence instead. This documentation will improve over time +with your help! If you have ideas how to improve this part of the documentation, +feel free to share them in a +[GitHub issue](https://github.com/ory/docs/issues/new) any time. ::: ## Authentication -* API Key (sessionToken) - - Parameter Name: **Authorization**, in: header. +- API Key (sessionToken) + - Parameter Name: **Authorization**, in: header. @@ -42,14 +43,15 @@ Accept: application/json ``` -This endpoint returns a 200 status code when the HTTP server is up running. -This status does currently not include checks whether the database connection is working. +This endpoint returns a 200 status code when the HTTP server is up running. This +status does currently not include checks whether the database connection is +working. 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. +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. #### Responses @@ -57,10 +59,10 @@ refer to the cluster state, only to a single instance. ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|healthStatus|[healthStatus](#schemahealthstatus)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | healthStatus | [healthStatus](#schemahealthstatus) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -72,9 +74,7 @@ refer to the cluster state, only to a single instance. } ``` - + #### Code samples @@ -100,7 +100,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -120,20 +120,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/health/alive', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -210,14 +210,14 @@ Accept: application/json ``` -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 returns a 200 status code when the HTTP server is up running and +the environment dependencies (e.g. the database) are responsive as well. 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. +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. #### Responses @@ -225,10 +225,10 @@ refer to the cluster state, only to a single instance. ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|healthStatus|[healthStatus](#schemahealthstatus)| -|503|[Service Unavailable](https://tools.ietf.org/html/rfc7231#section-6.6.4)|healthNotReadyStatus|[healthNotReadyStatus](#schemahealthnotreadystatus)| +| Status | Meaning | Description | Schema | +| ------ | ------------------------------------------------------------------------ | -------------------- | --------------------------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | healthStatus | [healthStatus](#schemahealthstatus) | +| 503 | [Service Unavailable](https://tools.ietf.org/html/rfc7231#section-6.6.4) | healthNotReadyStatus | [healthNotReadyStatus](#schemahealthnotreadystatus) | ##### Examples @@ -240,9 +240,7 @@ refer to the cluster state, only to a single instance. } ``` - + #### Code samples @@ -268,7 +266,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -288,20 +286,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/health/ready', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -384,16 +382,17 @@ Accept: application/json Lists all identities. Does not support search at the moment. -Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). +Learn how identities work in +[ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|per_page|query|integer(int64)|false|Items per Page| -|page|query|integer(int64)|false|Pagination Page| +| Parameter | In | Type | Required | Description | +| --------- | ----- | -------------- | -------- | --------------- | +| per_page | query | integer(int64) | false | Items per Page | +| page | query | integer(int64) | false | Pagination Page | ##### Detailed descriptions @@ -407,10 +406,10 @@ This is the number of items per page. ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|A list of identities.|Inline| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | --------------------- | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | A list of identities. | Inline | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | @@ -418,24 +417,24 @@ This is the number of items per page. Status Code **200** -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|[[Identity](#schemaidentity)]|false|none|none| -|» id|[UUID](#schemauuid)(uuid4)|true|none|none| -|» recovery_addresses|[[RecoveryAddress](#schemarecoveryaddress)]|false|none|RecoveryAddresses contains all the addresses that can be used to recover an identity.| -|»» id|[UUID](#schemauuid)(uuid4)|true|none|none| -|»» value|string|true|none|none| -|»» via|[RecoveryAddressType](#schemarecoveryaddresstype)|true|none|none| -|» schema_id|string|true|none|SchemaID is the ID of the JSON Schema to be used for validating the identity's traits.| -|» schema_url|string|false|none|SchemaURL is the URL of the endpoint where the identity's traits schema can be fetched from.

format: url| -|» traits|[Traits](#schematraits)|true|none|none| -|» verifiable_addresses|[[VerifiableAddress](#schemaverifiableaddress)]|false|none|VerifiableAddresses contains all the addresses that can be verified by the user.| -|»» id|[UUID](#schemauuid)(uuid4)|true|none|none| -|»» status|[VerifiableAddressStatus](#schemaverifiableaddressstatus)|true|none|none| -|»» value|string|true|none|none| -|»» verified|boolean|true|none|none| -|»» verified_at|[NullTime](#schemanulltime)(date-time)|false|none|none| -|»» via|[VerifiableAddressType](#schemaverifiableaddresstype)|true|none|none| +| Name | Type | Required | Restrictions | Description | +| ---------------------- | --------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------- | +| _anonymous_ | [[Identity](#schemaidentity)] | false | none | none | +| » id | [UUID](#schemauuid)(uuid4) | true | none | none | +| » recovery_addresses | [[RecoveryAddress](#schemarecoveryaddress)] | false | none | RecoveryAddresses contains all the addresses that can be used to recover an identity. | +| »» id | [UUID](#schemauuid)(uuid4) | true | none | none | +| »» value | string | true | none | none | +| »» via | [RecoveryAddressType](#schemarecoveryaddresstype) | true | none | none | +| » schema_id | string | true | none | SchemaID is the ID of the JSON Schema to be used for validating the identity's traits. | +| » schema_url | string | false | none | SchemaURL is the URL of the endpoint where the identity's traits schema can be fetched from.

format: url | +| » traits | [Traits](#schematraits) | true | none | none | +| » verifiable_addresses | [[VerifiableAddress](#schemaverifiableaddress)] | false | none | VerifiableAddresses contains all the addresses that can be verified by the user. | +| »» id | [UUID](#schemauuid)(uuid4) | true | none | none | +| »» status | [VerifiableAddressStatus](#schemaverifiableaddressstatus) | true | none | none | +| »» value | string | true | none | none | +| »» verified | boolean | true | none | none | +| »» verified_at | [NullTime](#schemanulltime)(date-time) | false | none | none | +| »» via | [VerifiableAddressType](#schemaverifiableaddresstype) | true | none | none | ##### Examples @@ -469,9 +468,7 @@ Status Code **200** ] ``` - + #### Code samples @@ -497,7 +494,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -517,20 +514,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/identities', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -608,10 +605,12 @@ Accept: application/json ``` -This endpoint creates an identity. It is NOT possible to set an identity's credentials (password, ...) -using this method! A way to achieve that will be introduced in the future. +This endpoint creates an identity. It is NOT possible to set an identity's +credentials (password, ...) using this method! A way to achieve that will be +introduced in the future. -Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). +Learn how identities work in +[ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). #### Request body @@ -626,9 +625,9 @@ Learn how identities work in [ORY Kratos' User And Identity Model Documentation] #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|body|body|[CreateIdentity](#schemacreateidentity)|false|none| +| Parameter | In | Type | Required | Description | +| --------- | ---- | --------------------------------------- | -------- | ----------- | +| body | body | [CreateIdentity](#schemacreateidentity) | false | none | #### Responses @@ -636,11 +635,11 @@ Learn how identities work in [ORY Kratos' User And Identity Model Documentation] ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|A single identity.|[Identity](#schemaidentity)| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------------ | ----------------------------------- | +| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | A single identity. | [Identity](#schemaidentity) | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -672,9 +671,7 @@ Learn how identities work in [ORY Kratos' User And Identity Model Documentation] } ``` - + #### Code samples @@ -700,7 +697,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, } @@ -817,15 +814,16 @@ Accept: application/json ``` -Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). +Learn how identities work in +[ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|id|path|string|true|ID must be set to the ID of identity you want to get| +| Parameter | In | Type | Required | Description | +| --------- | ---- | ------ | -------- | ---------------------------------------------------- | +| id | path | string | true | ID must be set to the ID of identity you want to get | #### Responses @@ -833,11 +831,11 @@ Learn how identities work in [ORY Kratos' User And Identity Model Documentation] ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|A single identity.|[Identity](#schemaidentity)| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | A single identity. | [Identity](#schemaidentity) | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -869,9 +867,7 @@ Learn how identities work in [ORY Kratos' User And Identity Model Documentation] } ``` - + #### Code samples @@ -897,7 +893,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -917,20 +913,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/identities/{id}', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -1008,12 +1004,15 @@ Accept: application/json ``` -This endpoint updates an identity. It is NOT possible to set an identity's credentials (password, ...) -using this method! A way to achieve that will be introduced in the future. +This endpoint updates an identity. It is NOT possible to set an identity's +credentials (password, ...) using this method! A way to achieve that will be +introduced in the future. -The full identity payload (except credentials) is expected. This endpoint does not support patching. +The full identity payload (except credentials) is expected. This endpoint does +not support patching. -Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). +Learn how identities work in +[ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). #### Request body @@ -1028,10 +1027,10 @@ Learn how identities work in [ORY Kratos' User And Identity Model Documentation] #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|id|path|string|true|ID must be set to the ID of identity you want to update| -|body|body|[UpdateIdentity](#schemaupdateidentity)|false|none| +| Parameter | In | Type | Required | Description | +| --------- | ---- | --------------------------------------- | -------- | ------------------------------------------------------- | +| id | path | string | true | ID must be set to the ID of identity you want to update | +| body | body | [UpdateIdentity](#schemaupdateidentity) | false | none | #### Responses @@ -1039,12 +1038,12 @@ Learn how identities work in [ORY Kratos' User And Identity Model Documentation] ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|A single identity.|[Identity](#schemaidentity)| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|genericError|[genericError](#schemagenericerror)| -|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | A single identity. | [Identity](#schemaidentity) | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | genericError | [genericError](#schemagenericerror) | +| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -1076,9 +1075,7 @@ Learn how identities work in [ORY Kratos' User And Identity Model Documentation] } ``` - + #### Code samples @@ -1104,7 +1101,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, } @@ -1221,19 +1218,21 @@ Accept: application/json ``` -Calling this endpoint irrecoverably and permanently deletes the identity given its ID. This action can not be undone. -This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is +Calling this endpoint irrecoverably and permanently deletes the identity given +its ID. This action can not be undone. This endpoint returns 204 when the +identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already. -Learn how identities work in [ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). +Learn how identities work in +[ORY Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|id|path|string|true|ID is the identity's ID.| +| Parameter | In | Type | Required | Description | +| --------- | ---- | ------ | -------- | ------------------------ | +| id | path | string | true | ID is the identity's ID. | #### Responses @@ -1241,11 +1240,11 @@ Learn how identities work in [ORY Kratos' User And Identity Model Documentation] ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -1265,9 +1264,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -1293,7 +1290,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -1313,20 +1310,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/identities/{id}', { method: 'DELETE', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -1396,6 +1393,7 @@ p JSON.parse(result) ### Get snapshot metrics from the Hydra service. If you're using k8s, you can then add annotations to + your deployment like so: ``` @@ -1412,19 +1410,19 @@ prometheus.io/path: "/metrics/prometheus" #### Responses - + ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| +| Status | Meaning | Description | Schema | +| -------------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------ | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | - + #### Code samples @@ -1467,15 +1465,15 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') fetch('/metrics/prometheus', { method: 'GET' }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -1544,8 +1542,8 @@ Accept: application/json ``` -This endpoint creates a recovery link which should be given to the user in order for them to recover -(or activate) their account. +This endpoint creates a recovery link which should be given to the user in order +for them to recover (or activate) their account. #### Request body @@ -1560,9 +1558,9 @@ This endpoint creates a recovery link which should be given to the user in order #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|body|body|[CreateRecoveryLink](#schemacreaterecoverylink)|false|none| +| Parameter | In | Type | Required | Description | +| --------- | ---- | ----------------------------------------------- | -------- | ----------- | +| body | body | [CreateRecoveryLink](#schemacreaterecoverylink) | false | none | #### Responses @@ -1570,12 +1568,12 @@ This endpoint creates a recovery link which should be given to the user in order ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|recoveryLink|[recoveryLink](#schemarecoverylink)| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|genericError|[genericError](#schemagenericerror)| -|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | recoveryLink | [recoveryLink](#schemarecoverylink) | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | genericError | [genericError](#schemagenericerror) | +| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -1588,9 +1586,7 @@ This endpoint creates a recovery link which should be given to the user in order } ``` - + #### Code samples @@ -1616,7 +1612,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, } @@ -1743,9 +1739,9 @@ Get a Traits Schema Definition #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|id|path|string|true|ID must be set to the ID of schema you want to get| +| Parameter | In | Type | Required | Description | +| --------- | ---- | ------ | -------- | -------------------------------------------------- | +| id | path | string | true | ID must be set to the ID of schema you want to get | #### Responses @@ -1753,11 +1749,11 @@ Get a Traits Schema Definition ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|The raw identity traits schema|Inline| -|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------------------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | The raw identity traits schema | Inline | +| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | @@ -1771,9 +1767,7 @@ Get a Traits Schema Definition {} ``` - + #### Code samples @@ -1799,7 +1793,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -1819,20 +1813,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/schemas/{id}', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -1909,24 +1903,27 @@ Accept: application/json ``` -This endpoint returns the error associated with a user-facing self service errors. +This endpoint returns the error associated with a user-facing self service +errors. -When accessing this endpoint through ORY Kratos' Public API, ensure that cookies are set as they are required for CSRF to work. To prevent -token scanning attacks, the public endpoint does not return 404 status codes. +When accessing this endpoint through ORY Kratos' Public API, ensure that cookies +are set as they are required for CSRF to work. To prevent token scanning +attacks, the public endpoint does not return 404 status codes. This endpoint supports stub values to help you implement the error UI: `?error=stub:500` - returns a stub 500 (Internal Server Error) error. -More information can be found at [ORY Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors). +More information can be found at +[ORY Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|error|query|string|true|Error is the container's ID| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ------ | -------- | --------------------------- | +| error | query | string | true | Error is the container's ID | #### Responses @@ -1934,12 +1931,12 @@ More information can be found at [ORY Kratos User User Facing Error Documentatio ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|User-facing error response|[errorContainer](#schemaerrorcontainer)| -|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|genericError|[genericError](#schemagenericerror)| -|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | -------------------------- | --------------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | User-facing error response | [errorContainer](#schemaerrorcontainer) | +| 403 | [Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) | genericError | [genericError](#schemagenericerror) | +| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -1952,9 +1949,7 @@ More information can be found at [ORY Kratos User User Facing Error Documentatio } ``` - + #### Code samples @@ -1980,7 +1975,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -2000,20 +1995,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/errors?error=string', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -2092,17 +2087,19 @@ Accept: application/json ``` -This endpoint returns a login flow's context with, for example, error details and other information. +This endpoint returns a login flow's context with, for example, error details +and other information. -More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). +More information can be found at +[ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|id|query|string|true|The Login Flow ID| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ------ | -------- | ----------------- | +| id | query | string | true | The Login Flow ID | ##### Detailed descriptions @@ -2117,13 +2114,13 @@ application (e.g. `/login?flow=abcde`). ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|loginFlow|[loginFlow](#schemaloginflow)| -|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|genericError|[genericError](#schemagenericerror)| -|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|genericError|[genericError](#schemagenericerror)| -|410|[Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | loginFlow | [loginFlow](#schemaloginflow) | +| 403 | [Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) | genericError | [genericError](#schemagenericerror) | +| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | genericError | [genericError](#schemagenericerror) | +| 410 | [Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -2253,9 +2250,7 @@ application (e.g. `/login?flow=abcde`). } ``` - + #### Code samples @@ -2281,7 +2276,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -2301,20 +2296,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/login/flows?id=string', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -2393,24 +2388,26 @@ Accept: application/json ``` -This endpoint returns a recovery flow's context with, for example, error details and other information. +This endpoint returns a recovery flow's context with, for example, error details +and other information. -More information can be found at [ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). +More information can be found at +[ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|id|query|string|true|The Flow ID| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ------ | -------- | ----------- | +| id | query | string | true | The Flow ID | ##### Detailed descriptions **id**: The Flow ID -The value for this parameter comes from `request` URL Query parameter sent to your -application (e.g. `/recovery?flow=abcde`). +The value for this parameter comes from `request` URL Query parameter sent to +your application (e.g. `/recovery?flow=abcde`). #### Responses @@ -2418,12 +2415,12 @@ application (e.g. `/recovery?flow=abcde`). ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|recoveryFlow|[recoveryFlow](#schemarecoveryflow)| -|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|genericError|[genericError](#schemagenericerror)| -|410|[Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | recoveryFlow | [recoveryFlow](#schemarecoveryflow) | +| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | genericError | [genericError](#schemagenericerror) | +| 410 | [Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -2517,9 +2514,7 @@ application (e.g. `/recovery?flow=abcde`). } ``` - + #### Code samples @@ -2545,7 +2540,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -2565,20 +2560,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/recovery/flows?id=string', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -2657,17 +2652,19 @@ Accept: application/json ``` -This endpoint returns a registration flow's context with, for example, error details and other information. +This endpoint returns a registration flow's context with, for example, error +details and other information. -More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). +More information can be found at +[ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|id|query|string|true|The Registration Flow ID| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ------ | -------- | ------------------------ | +| id | query | string | true | The Registration Flow ID | ##### Detailed descriptions @@ -2682,13 +2679,13 @@ application (e.g. `/registration?flow=abcde`). ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|registrationFlow|[registrationFlow](#schemaregistrationflow)| -|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|genericError|[genericError](#schemagenericerror)| -|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|genericError|[genericError](#schemagenericerror)| -|410|[Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ---------------- | ------------------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | registrationFlow | [registrationFlow](#schemaregistrationflow) | +| 403 | [Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) | genericError | [genericError](#schemagenericerror) | +| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | genericError | [genericError](#schemagenericerror) | +| 410 | [Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -2817,9 +2814,7 @@ application (e.g. `/registration?flow=abcde`). } ``` - + #### Code samples @@ -2845,7 +2840,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -2865,20 +2860,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/registration/flows?id=string', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -2957,21 +2952,24 @@ Accept: application/json ``` -When accessing this endpoint through ORY Kratos' Public API you must ensure that either the ORY Kratos Session Cookie -or the ORY Kratos Session Token are set. The public endpoint does not return 404 status codes -but instead 403 or 500 to improve data privacy. +When accessing this endpoint through ORY Kratos' Public API you must ensure that +either the ORY Kratos Session Cookie or the ORY Kratos Session Token are set. +The public endpoint does not return 404 status codes but instead 403 or 500 to +improve data privacy. -You can access this endpoint without credentials when using ORY Kratos' Admin API. +You can access this endpoint without credentials when using ORY Kratos' Admin +API. -More information can be found at [ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). +More information can be found at +[ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|id|query|string|true|ID is the Settings Flow ID| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ------ | -------- | -------------------------- | +| id | query | string | true | ID is the Settings Flow ID | ##### Detailed descriptions @@ -2986,13 +2984,13 @@ application (e.g. `/settings?flow=abcde`). ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|settingsFlow|[settingsFlow](#schemasettingsflow)| -|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|genericError|[genericError](#schemagenericerror)| -|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|genericError|[genericError](#schemagenericerror)| -|410|[Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | settingsFlow | [settingsFlow](#schemasettingsflow) | +| 403 | [Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) | genericError | [genericError](#schemagenericerror) | +| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | genericError | [genericError](#schemagenericerror) | +| 410 | [Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -3109,9 +3107,7 @@ application (e.g. `/settings?flow=abcde`). } ``` - + #### Code samples @@ -3137,7 +3133,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -3157,20 +3153,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/settings/flows?id=string', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -3249,24 +3245,26 @@ Accept: application/json ``` -This endpoint returns a verification flow's context with, for example, error details and other information. +This endpoint returns a verification flow's context with, for example, error +details and other information. -More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). +More information can be found at +[ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|id|query|string|true|The Flow ID| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ------ | -------- | ----------- | +| id | query | string | true | The Flow ID | ##### Detailed descriptions **id**: The Flow ID -The value for this parameter comes from `request` URL Query parameter sent to your -application (e.g. `/verification?flow=abcde`). +The value for this parameter comes from `request` URL Query parameter sent to +your application (e.g. `/verification?flow=abcde`). #### Responses @@ -3274,12 +3272,12 @@ application (e.g. `/verification?flow=abcde`). ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|verificationFlow|[verificationFlow](#schemaverificationflow)| -|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|genericError|[genericError](#schemagenericerror)| -|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ---------------- | ------------------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | verificationFlow | [verificationFlow](#schemaverificationflow) | +| 403 | [Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) | genericError | [genericError](#schemagenericerror) | +| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -3373,9 +3371,7 @@ application (e.g. `/verification?flow=abcde`). } ``` - + #### Code samples @@ -3401,7 +3397,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -3421,20 +3417,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/verification/flows?id=string', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -3519,12 +3515,14 @@ Accept: application/json This endpoint initializes a logout flow. -> This endpoint is NOT INTENDED for API clients and only works -with browsers (Chrome, Firefox, ...). +> This endpoint is NOT INTENDED for API clients and only works with browsers +> (Chrome, Firefox, ...). -On successful logout, the browser will be redirected (HTTP 302 Found) to `urls.default_return_to`. +On successful logout, the browser will be redirected (HTTP 302 Found) to +`urls.default_return_to`. -More information can be found at [ORY Kratos User Logout Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-logout). +More information can be found at +[ORY Kratos User Logout Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-logout). #### Responses @@ -3532,11 +3530,11 @@ More information can be found at [ORY Kratos User Logout Documentation](https:// ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -3556,9 +3554,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -3584,7 +3580,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -3604,20 +3600,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/browser/flows/logout', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -3694,12 +3690,14 @@ Accept: application/json ``` -This endpoint completes a browser-based settings flow. This is usually achieved by POSTing data to this -endpoint. +This endpoint completes a browser-based settings flow. This is usually achieved +by POSTing data to this endpoint. -> This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...) and HTML Forms. +> This endpoint is NOT INTENDED for API clients and only works with browsers +> (Chrome, Firefox, ...) and HTML Forms. -More information can be found at [ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). +More information can be found at +[ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). #### Responses @@ -3707,11 +3705,11 @@ More information can be found at [ORY Kratos User Settings & Profile Management ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -3731,9 +3729,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -3759,7 +3755,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -3779,20 +3775,23 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } -fetch('/self-service/browser/flows/registration/strategies/oidc/settings/connections', { - method: 'POST', - headers -}) -.then(r => r.json()) -.then((body) => { +fetch( + '/self-service/browser/flows/registration/strategies/oidc/settings/connections', + { + method: 'POST', + headers + } +) + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -3869,40 +3868,44 @@ Accept: application/json ``` -This endpoint initiates a login flow for API clients such as mobile devices, smart TVs, and so on. +This endpoint initiates a login flow for API clients such as mobile devices, +smart TVs, and so on. -If a valid provided session cookie or session token is provided, a 400 Bad Request error -will be returned unless the URL query parameter `?refresh=true` is set. +If a valid provided session cookie or session token is provided, a 400 Bad +Request error will be returned unless the URL query parameter `?refresh=true` is +set. To fetch an existing login flow call `/self-service/login/flows?flow=`. :::warning -You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server -Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make -you vulnerable to a variety of CSRF attacks, including CSRF login attacks. +You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, +AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser +applications. Using this endpoint in these applications will make you vulnerable +to a variety of CSRF attacks, including CSRF login attacks. -This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). +This endpoint MUST ONLY be used in scenarios such as native mobile apps (React +Native, Objective C, Swift, Java, ...). ::: -More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). +More information can be found at +[ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|refresh|query|boolean|false|Refresh a login session| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ------- | -------- | ----------------------- | +| refresh | query | boolean | false | Refresh a login session | ##### Detailed descriptions **refresh**: 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. +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. #### Responses @@ -3910,11 +3913,11 @@ authenticated_at time of the session. ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|loginFlow|[loginFlow](#schemaloginflow)| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | loginFlow | [loginFlow](#schemaloginflow) | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -4044,9 +4047,7 @@ authenticated_at time of the session. } ``` - + #### Code samples @@ -4072,7 +4073,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -4092,20 +4093,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/login/api', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -4182,14 +4183,17 @@ Accept: application/json ``` -This endpoint initializes a browser-based user login flow. Once initialized, the browser will be redirected to -`selfservice.flows.login.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session -exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter -`?refresh=true` was set. +This endpoint initializes a browser-based user login flow. Once initialized, the +browser will be redirected to `selfservice.flows.login.ui_url` with the flow ID +set as the query parameter `?flow=`. If a valid user session exists already, the +browser will be redirected to `urls.default_redirect_url` unless the query +parameter `?refresh=true` was set. -This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). +This endpoint is NOT INTENDED for API clients and only works with browsers +(Chrome, Firefox, ...). -More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). +More information can be found at +[ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). #### Responses @@ -4197,11 +4201,11 @@ More information can be found at [ORY Kratos User Login and User Registration Do ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -4221,9 +4225,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -4249,7 +4251,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -4269,20 +4271,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/login/browser', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -4359,30 +4361,32 @@ Accept: application/json ``` -Use this endpoint to complete a login flow by sending an identity's identifier and password. This endpoint -behaves differently for API and browser flows. +Use this endpoint to complete a login flow by sending an identity's identifier +and password. This endpoint behaves differently for API and browser flows. API flows expect `application/json` to be sent in the body and responds with -HTTP 200 and a application/json body with the session token on success; -HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; -HTTP 400 on form validation errors. +HTTP 200 and a application/json body with the session token on success; HTTP 302 +redirect to a fresh login flow if the original flow expired with the appropriate +error messages set; HTTP 400 on form validation errors. -Browser flows expect `application/x-www-form-urlencoded` to be sent in the body and responds with -a HTTP 302 redirect to the post/after login URL or the `return_to` value if it was set and if the login succeeded; -a HTTP 302 redirect to the login UI URL with the flow ID containing the validation errors otherwise. +Browser flows expect `application/x-www-form-urlencoded` to be sent in the body +and responds with a HTTP 302 redirect to the post/after login URL or the +`return_to` value if it was set and if the login succeeded; a HTTP 302 redirect +to the login UI URL with the flow ID containing the validation errors otherwise. -More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). +More information can be found at +[ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|password|query|string|false|The user's password.| -|identifier|query|string|false|Identifier is the email or username of the user trying to log in.| -|csrf_token|query|string|false|Sending the anti-csrf token is only required for browser login flows.| -|flow|query|string|true|The Flow ID| +| Parameter | In | Type | Required | Description | +| ---------- | ----- | ------ | -------- | --------------------------------------------------------------------- | +| password | query | string | false | The user's password. | +| identifier | query | string | false | Identifier is the email or username of the user trying to log in. | +| csrf_token | query | string | false | Sending the anti-csrf token is only required for browser login flows. | +| flow | query | string | true | The Flow ID | #### Responses @@ -4390,13 +4394,13 @@ More information can be found at [ORY Kratos User Login and User Registration Do ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|loginViaApiResponse|[loginViaApiResponse](#schemaloginviaapiresponse)| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|loginFlow|[loginFlow](#schemaloginflow)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | loginViaApiResponse | [loginViaApiResponse](#schemaloginviaapiresponse) | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | loginFlow | [loginFlow](#schemaloginflow) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -4438,9 +4442,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -4466,7 +4468,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -4486,20 +4488,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/login/methods/password?flow=string', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -4578,23 +4580,29 @@ Accept: application/json ``` -This endpoint initiates a recovery flow for API clients such as mobile devices, smart TVs, and so on. +This endpoint initiates a recovery flow for API clients such as mobile devices, +smart TVs, and so on. -If a valid provided session cookie or session token is provided, a 400 Bad Request error. +If a valid provided session cookie or session token is provided, a 400 Bad +Request error. -To fetch an existing recovery flow call `/self-service/recovery/flows?flow=`. +To fetch an existing recovery flow call +`/self-service/recovery/flows?flow=`. :::warning -You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server -Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make -you vulnerable to a variety of CSRF attacks. +You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, +AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser +applications. Using this endpoint in these applications will make you vulnerable +to a variety of CSRF attacks. -This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). +This endpoint MUST ONLY be used in scenarios such as native mobile apps (React +Native, Objective C, Swift, Java, ...). ::: -More information can be found at [ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). +More information can be found at +[ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). #### Responses @@ -4602,11 +4610,11 @@ More information can be found at [ORY Kratos Account Recovery Documentation](../ ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|recoveryFlow|[recoveryFlow](#schemarecoveryflow)| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | recoveryFlow | [recoveryFlow](#schemarecoveryflow) | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -4700,9 +4708,7 @@ More information can be found at [ORY Kratos Account Recovery Documentation](../ } ``` - + #### Code samples @@ -4728,7 +4734,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -4748,20 +4754,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/recovery/api', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -4838,13 +4844,17 @@ Accept: application/json ``` -This endpoint initializes a browser-based account recovery flow. Once initialized, the browser will be redirected to -`selfservice.flows.recovery.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session -exists, the browser is returned to the configured return URL. +This endpoint initializes a browser-based account recovery flow. Once +initialized, the browser will be redirected to +`selfservice.flows.recovery.ui_url` with the flow ID set as the query parameter +`?flow=`. If a valid user session exists, the browser is returned to the +configured return URL. -This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). +This endpoint is NOT INTENDED for API clients and only works with browsers +(Chrome, Firefox, ...). -More information can be found at [ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). +More information can be found at +[ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). #### Responses @@ -4852,11 +4862,11 @@ More information can be found at [ORY Kratos Account Recovery Documentation](../ ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -4876,9 +4886,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -4904,7 +4912,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -4924,20 +4932,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/recovery/browser', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -5015,22 +5023,27 @@ Accept: application/json ``` -Use this endpoint to complete a recovery flow using the link method. This endpoint -behaves differently for API and browser flows and has several states: +Use this endpoint to complete a recovery flow using the link method. This +endpoint behaves differently for API and browser flows and has several states: -`choose_method` expects `flow` (in the URL query) and `email` (in the body) to be sent -and works with API- and Browser-initiated flows. -For API clients it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid -and a HTTP 302 Found redirect with a fresh recovery flow if the flow was otherwise invalid (e.g. expired). -For Browser clients it returns a HTTP 302 Found redirect to the Recovery UI URL with the Recovery Flow ID appended. -`sent_email` is the success state after `choose_method` and allows the user to request another recovery email. It -works for both API and Browser-initiated flows and returns the same responses as the flow in `choose_method` state. -`passed_challenge` expects a `token` to be sent in the URL query and given the nature of the flow ("sending a recovery link") -does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL -(if the link was valid) and instructs the user to update their password, or a redirect to the Recover UI URL with -a new Recovery Flow ID which contains an error message that the recovery link was invalid. +`choose_method` expects `flow` (in the URL query) and `email` (in the body) to +be sent and works with API- and Browser-initiated flows. For API clients it +either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the +form is invalid and a HTTP 302 Found redirect with a fresh recovery flow if the +flow was otherwise invalid (e.g. expired). For Browser clients it returns a HTTP +302 Found redirect to the Recovery UI URL with the Recovery Flow ID appended. +`sent_email` is the success state after `choose_method` and allows the user to +request another recovery email. It works for both API and Browser-initiated +flows and returns the same responses as the flow in `choose_method` state. +`passed_challenge` expects a `token` to be sent in the URL query and given the +nature of the flow ("sending a recovery link") does not have any API +capabilities. The server responds with a HTTP 302 Found redirect either to the +Settings UI URL (if the link was valid) and instructs the user to update their +password, or a redirect to the Recover UI URL with a new Recovery Flow ID which +contains an error message that the recovery link was invalid. -More information can be found at [ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). +More information can be found at +[ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). #### Request body @@ -5044,25 +5057,24 @@ More information can be found at [ORY Kratos Account Recovery Documentation](../ ```yaml csrf_token: string email: string - ``` #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|token|query|string|false|Recovery Token| -|flow|query|string|false|The Flow ID| -|body|body|[completeSelfServiceRecoveryFlowWithLinkMethod](#schemacompleteselfservicerecoveryflowwithlinkmethod)|false|none| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ----------------------------------------------------------------------------------------------------- | -------- | -------------- | +| token | query | string | false | Recovery Token | +| flow | query | string | false | The Flow ID | +| body | body | [completeSelfServiceRecoveryFlowWithLinkMethod](#schemacompleteselfservicerecoveryflowwithlinkmethod) | false | none | ##### Detailed descriptions **token**: Recovery Token -The recovery token which completes the recovery request. If the token -is invalid (e.g. expired) an error will be shown to the end-user. +The recovery token which completes the recovery request. If the token is invalid +(e.g. expired) an error will be shown to the end-user. **flow**: The Flow ID @@ -5074,12 +5086,12 @@ format: uuid ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|recoveryFlow|[recoveryFlow](#schemarecoveryflow)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | recoveryFlow | [recoveryFlow](#schemarecoveryflow) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -5173,9 +5185,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -5201,7 +5211,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, } @@ -5318,24 +5328,30 @@ Accept: application/json ``` -This endpoint initiates a registration flow for API clients such as mobile devices, smart TVs, and so on. +This endpoint initiates a registration flow for API clients such as mobile +devices, smart TVs, and so on. -If a valid provided session cookie or session token is provided, a 400 Bad Request error -will be returned unless the URL query parameter `?refresh=true` is set. +If a valid provided session cookie or session token is provided, a 400 Bad +Request error will be returned unless the URL query parameter `?refresh=true` is +set. -To fetch an existing registration flow call `/self-service/registration/flows?flow=`. +To fetch an existing registration flow call +`/self-service/registration/flows?flow=`. :::warning -You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server -Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make -you vulnerable to a variety of CSRF attacks. +You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, +AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser +applications. Using this endpoint in these applications will make you vulnerable +to a variety of CSRF attacks. -This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). +This endpoint MUST ONLY be used in scenarios such as native mobile apps (React +Native, Objective C, Swift, Java, ...). ::: -More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). +More information can be found at +[ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). #### Responses @@ -5343,11 +5359,11 @@ More information can be found at [ORY Kratos User Login and User Registration Do ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|registrationFlow|[registrationFlow](#schemaregistrationflow)| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ---------------- | ------------------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | registrationFlow | [registrationFlow](#schemaregistrationflow) | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -5476,9 +5492,7 @@ More information can be found at [ORY Kratos User Login and User Registration Do } ``` - + #### Code samples @@ -5504,7 +5518,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -5524,20 +5538,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/registration/api', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -5614,18 +5628,22 @@ Accept: application/json ``` -This endpoint initializes a browser-based user registration flow. Once initialized, the browser will be redirected to -`selfservice.flows.registration.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session -exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter +This endpoint initializes a browser-based user registration flow. Once +initialized, the browser will be redirected to +`selfservice.flows.registration.ui_url` with the flow ID set as the query +parameter `?flow=`. If a valid user session exists already, the browser will be +redirected to `urls.default_redirect_url` unless the query parameter `?refresh=true` was set. :::note -This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). +This endpoint is NOT INTENDED for API clients and only works with browsers +(Chrome, Firefox, ...). ::: -More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). +More information can be found at +[ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). #### Responses @@ -5633,11 +5651,11 @@ More information can be found at [ORY Kratos User Login and User Registration Do ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -5657,9 +5675,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -5685,7 +5701,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -5705,20 +5721,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/registration/browser', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -5796,20 +5812,25 @@ Accept: application/json ``` -Use this endpoint to complete a registration flow by sending an identity's traits and password. This endpoint -behaves differently for API and browser flows. +Use this endpoint to complete a registration flow by sending an identity's +traits and password. This endpoint behaves differently for API and browser +flows. -API flows expect `application/json` to be sent in the body and respond with -HTTP 200 and a application/json body with the created identity success - if the session hook is configured the -`session` and `session_token` will also be included; -HTTP 302 redirect to a fresh registration flow if the original flow expired with the appropriate error messages set; -HTTP 400 on form validation errors. +API flows expect `application/json` to be sent in the body and respond with HTTP +200 and a application/json body with the created identity success - if the +session hook is configured the `session` and `session_token` will also be +included; HTTP 302 redirect to a fresh registration flow if the original flow +expired with the appropriate error messages set; HTTP 400 on form validation +errors. -Browser flows expect `application/x-www-form-urlencoded` to be sent in the body and responds with -a HTTP 302 redirect to the post/after registration URL or the `return_to` value if it was set and if the registration succeeded; -a HTTP 302 redirect to the registration UI URL with the flow ID containing the validation errors otherwise. +Browser flows expect `application/x-www-form-urlencoded` to be sent in the body +and responds with a HTTP 302 redirect to the post/after registration URL or the +`return_to` value if it was set and if the registration succeeded; a HTTP 302 +redirect to the registration UI URL with the flow ID containing the validation +errors otherwise. -More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). +More information can be found at +[ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). #### Request body @@ -5819,17 +5840,16 @@ More information can be found at [ORY Kratos User Login and User Registration Do ```yaml {} - ``` #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|flow|query|string|false|Flow is flow ID.| -|body|body|object|false|none| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ------ | -------- | ---------------- | +| flow | query | string | false | Flow is flow ID. | +| body | body | object | false | none | #### Responses @@ -5837,13 +5857,13 @@ More information can be found at [ORY Kratos User Login and User Registration Do ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|registrationViaApiResponse|[registrationViaApiResponse](#schemaregistrationviaapiresponse)| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|registrationFlow|[registrationFlow](#schemaregistrationflow)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | registrationViaApiResponse | [registrationViaApiResponse](#schemaregistrationviaapiresponse) | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | registrationFlow | [registrationFlow](#schemaregistrationflow) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -5908,9 +5928,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -5936,7 +5954,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, } @@ -5957,10 +5975,11 @@ func main() { ```javascript -const fetch = require('node-fetch'); -const input = '{}'; +const fetch = require('node-fetch') +const input = '{}' const headers = { - 'Content-Type': 'application/json', 'Accept': 'application/json' + 'Content-Type': 'application/json', + Accept: 'application/json' } fetch('/self-service/registration/methods/password', { @@ -5968,10 +5987,10 @@ fetch('/self-service/registration/methods/password', { body: input, headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -6050,22 +6069,27 @@ Accept: application/json ``` -This endpoint initiates a settings flow for API clients such as mobile devices, smart TVs, and so on. -You must provide a valid ORY Kratos Session Token for this endpoint to respond with HTTP 200 OK. +This endpoint initiates a settings flow for API clients such as mobile devices, +smart TVs, and so on. You must provide a valid ORY Kratos Session Token for this +endpoint to respond with HTTP 200 OK. -To fetch an existing settings flow call `/self-service/settings/flows?flow=`. +To fetch an existing settings flow call +`/self-service/settings/flows?flow=`. :::warning -You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server -Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make -you vulnerable to a variety of CSRF attacks. +You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, +AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser +applications. Using this endpoint in these applications will make you vulnerable +to a variety of CSRF attacks. -This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). +This endpoint MUST ONLY be used in scenarios such as native mobile apps (React +Native, Objective C, Swift, Java, ...). ::: -More information can be found at [ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). +More information can be found at +[ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). #### Responses @@ -6073,11 +6097,11 @@ More information can be found at [ORY Kratos User Settings & Profile Management ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|settingsFlow|[settingsFlow](#schemasettingsflow)| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | settingsFlow | [settingsFlow](#schemasettingsflow) | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -6194,9 +6218,7 @@ More information can be found at [ORY Kratos User Settings & Profile Management } ``` - + #### Code samples @@ -6222,7 +6244,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -6242,20 +6264,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/settings/api', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -6332,17 +6354,20 @@ Accept: application/json ``` -This endpoint initializes a browser-based user settings flow. Once initialized, the browser will be redirected to -`selfservice.flows.settings.ui_url` with the flow ID set as the query parameter `?flow=`. If no valid -ORY Kratos Session Cookie is included in the request, a login flow will be initialized. +This endpoint initializes a browser-based user settings flow. Once initialized, +the browser will be redirected to `selfservice.flows.settings.ui_url` with the +flow ID set as the query parameter `?flow=`. If no valid ORY Kratos Session +Cookie is included in the request, a login flow will be initialized. :::note -This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). +This endpoint is NOT INTENDED for API clients and only works with browsers +(Chrome, Firefox, ...). ::: -More information can be found at [ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). +More information can be found at +[ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). #### Responses @@ -6350,11 +6375,11 @@ More information can be found at [ORY Kratos User Settings & Profile Management ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -6374,9 +6399,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -6402,7 +6425,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -6422,20 +6445,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/settings/browser/flows', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -6513,23 +6536,26 @@ Accept: application/json ``` -Use this endpoint to complete a settings flow by sending an identity's updated password. This endpoint -behaves differently for API and browser flows. +Use this endpoint to complete a settings flow by sending an identity's updated +password. This endpoint behaves differently for API and browser flows. -API-initiated flows expect `application/json` to be sent in the body and respond with -HTTP 200 and an application/json body with the session token on success; -HTTP 302 redirect to a fresh settings flow if the original flow expired with the appropriate error messages set; -HTTP 400 on form validation errors. -HTTP 401 when the endpoint is called without a valid session token. -HTTP 403 when `selfservice.flows.settings.privileged_session_max_age` was reached. -Implies that the user needs to re-authenticate. +API-initiated flows expect `application/json` to be sent in the body and respond +with HTTP 200 and an application/json body with the session token on success; +HTTP 302 redirect to a fresh settings flow if the original flow expired with the +appropriate error messages set; HTTP 400 on form validation errors. HTTP 401 +when the endpoint is called without a valid session token. HTTP 403 when +`selfservice.flows.settings.privileged_session_max_age` was reached. Implies +that the user needs to re-authenticate. -Browser flows expect `application/x-www-form-urlencoded` to be sent in the body and responds with -a HTTP 302 redirect to the post/after settings URL or the `return_to` value if it was set and if the flow succeeded; -a HTTP 302 redirect to the Settings UI URL with the flow ID containing the validation errors otherwise. -a HTTP 302 redirect to the login endpoint when `selfservice.flows.settings.privileged_session_max_age` was reached. +Browser flows expect `application/x-www-form-urlencoded` to be sent in the body +and responds with a HTTP 302 redirect to the post/after settings URL or the +`return_to` value if it was set and if the flow succeeded; a HTTP 302 redirect +to the Settings UI URL with the flow ID containing the validation errors +otherwise. a HTTP 302 redirect to the login endpoint when +`selfservice.flows.settings.privileged_session_max_age` was reached. -More information can be found at [ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). +More information can be found at +[ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). #### Request body @@ -6543,17 +6569,16 @@ More information can be found at [ORY Kratos User Settings & Profile Management ```yaml csrf_token: string password: string - ``` #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|flow|query|string|false|Flow is flow ID.| -|body|body|[CompleteSelfServiceSettingsFlowWithPasswordMethod](#schemacompleteselfservicesettingsflowwithpasswordmethod)|false|none| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ------------------------------------------------------------------------------------------------------------- | -------- | ---------------- | +| flow | query | string | false | Flow is flow ID. | +| body | body | [CompleteSelfServiceSettingsFlowWithPasswordMethod](#schemacompleteselfservicesettingsflowwithpasswordmethod) | false | none | #### Responses @@ -6561,15 +6586,15 @@ password: string ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|settingsViaApiResponse|[settingsViaApiResponse](#schemasettingsviaapiresponse)| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|settingsFlow|[settingsFlow](#schemasettingsflow)| -|401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|genericError|[genericError](#schemagenericerror)| -|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | settingsViaApiResponse | [settingsViaApiResponse](#schemasettingsviaapiresponse) | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | settingsFlow | [settingsFlow](#schemasettingsflow) | +| 401 | [Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1) | genericError | [genericError](#schemagenericerror) | +| 403 | [Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -6711,9 +6736,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -6739,7 +6762,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, } @@ -6856,23 +6879,27 @@ Accept: application/json ``` -Use this endpoint to complete a settings flow by sending an identity's updated traits. This endpoint -behaves differently for API and browser flows. +Use this endpoint to complete a settings flow by sending an identity's updated +traits. This endpoint behaves differently for API and browser flows. -API-initiated flows expect `application/json` to be sent in the body and respond with -HTTP 200 and an application/json body with the session token on success; -HTTP 302 redirect to a fresh settings flow if the original flow expired with the appropriate error messages set; -HTTP 400 on form validation errors. -HTTP 401 when the endpoint is called without a valid session token. -HTTP 403 when `selfservice.flows.settings.privileged_session_max_age` was reached and a sensitive field was -updated (e.g. recovery email). Implies that the user needs to re-authenticate. +API-initiated flows expect `application/json` to be sent in the body and respond +with HTTP 200 and an application/json body with the session token on success; +HTTP 302 redirect to a fresh settings flow if the original flow expired with the +appropriate error messages set; HTTP 400 on form validation errors. HTTP 401 +when the endpoint is called without a valid session token. HTTP 403 when +`selfservice.flows.settings.privileged_session_max_age` was reached and a +sensitive field was updated (e.g. recovery email). Implies that the user needs +to re-authenticate. -Browser flows expect `application/x-www-form-urlencoded` to be sent in the body and responds with -a HTTP 302 redirect to the post/after settings URL or the `return_to` value if it was set and if the flow succeeded; -a HTTP 302 redirect to the settings UI URL with the flow ID containing the validation errors otherwise. -a HTTP 302 redirect to the login endpoint when `selfservice.flows.settings.privileged_session_max_age` was reached. +Browser flows expect `application/x-www-form-urlencoded` to be sent in the body +and responds with a HTTP 302 redirect to the post/after settings URL or the +`return_to` value if it was set and if the flow succeeded; a HTTP 302 redirect +to the settings UI URL with the flow ID containing the validation errors +otherwise. a HTTP 302 redirect to the login endpoint when +`selfservice.flows.settings.privileged_session_max_age` was reached. -More information can be found at [ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). +More information can be found at +[ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). #### Responses @@ -6880,15 +6907,15 @@ More information can be found at [ORY Kratos User Settings & Profile Management ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|settingsFlow|[settingsFlow](#schemasettingsflow)| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|settingsFlow|[settingsFlow](#schemasettingsflow)| -|401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|genericError|[genericError](#schemagenericerror)| -|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | settingsFlow | [settingsFlow](#schemasettingsflow) | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | settingsFlow | [settingsFlow](#schemasettingsflow) | +| 401 | [Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1) | genericError | [genericError](#schemagenericerror) | +| 403 | [Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -7005,9 +7032,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -7033,7 +7058,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -7053,20 +7078,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/settings/methods/profile', { method: 'POST', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -7143,21 +7168,26 @@ Accept: application/json ``` -This endpoint initiates a verification flow for API clients such as mobile devices, smart TVs, and so on. +This endpoint initiates a verification flow for API clients such as mobile +devices, smart TVs, and so on. -To fetch an existing verification flow call `/self-service/verification/flows?flow=`. +To fetch an existing verification flow call +`/self-service/verification/flows?flow=`. :::warning -You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server -Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make -you vulnerable to a variety of CSRF attacks. +You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, +AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser +applications. Using this endpoint in these applications will make you vulnerable +to a variety of CSRF attacks. -This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). +This endpoint MUST ONLY be used in scenarios such as native mobile apps (React +Native, Objective C, Swift, Java, ...). ::: -More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). +More information can be found at +[ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). #### Responses @@ -7165,11 +7195,11 @@ More information can be found at [ORY Kratos Email and Phone Verification Docume ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|verificationFlow|[verificationFlow](#schemaverificationflow)| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ---------------- | ------------------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | verificationFlow | [verificationFlow](#schemaverificationflow) | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -7263,9 +7293,7 @@ More information can be found at [ORY Kratos Email and Phone Verification Docume } ``` - + #### Code samples @@ -7291,7 +7319,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -7311,20 +7339,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/verification/api', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -7401,12 +7429,16 @@ Accept: application/json ``` -This endpoint initializes a browser-based account verification flow. Once initialized, the browser will be redirected to -`selfservice.flows.verification.ui_url` with the flow ID set as the query parameter `?flow=`. +This endpoint initializes a browser-based account verification flow. Once +initialized, the browser will be redirected to +`selfservice.flows.verification.ui_url` with the flow ID set as the query +parameter `?flow=`. -This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). +This endpoint is NOT INTENDED for API clients and only works with browsers +(Chrome, Firefox, ...). -More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). +More information can be found at +[ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). #### Responses @@ -7414,11 +7446,11 @@ More information can be found at [ORY Kratos Email and Phone Verification Docume ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -7438,9 +7470,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -7466,7 +7496,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -7486,20 +7516,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/self-service/verification/browser', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -7577,22 +7607,28 @@ Accept: application/json ``` -Use this endpoint to complete a verification flow using the link method. This endpoint -behaves differently for API and browser flows and has several states: +Use this endpoint to complete a verification flow using the link method. This +endpoint behaves differently for API and browser flows and has several states: -`choose_method` expects `flow` (in the URL query) and `email` (in the body) to be sent -and works with API- and Browser-initiated flows. -For API clients it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid -and a HTTP 302 Found redirect with a fresh verification flow if the flow was otherwise invalid (e.g. expired). -For Browser clients it returns a HTTP 302 Found redirect to the Verification UI URL with the Verification Flow ID appended. -`sent_email` is the success state after `choose_method` and allows the user to request another verification email. It -works for both API and Browser-initiated flows and returns the same responses as the flow in `choose_method` state. -`passed_challenge` expects a `token` to be sent in the URL query and given the nature of the flow ("sending a verification link") -does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL -(if the link was valid) and instructs the user to update their password, or a redirect to the Verification UI URL with -a new Verification Flow ID which contains an error message that the verification link was invalid. +`choose_method` expects `flow` (in the URL query) and `email` (in the body) to +be sent and works with API- and Browser-initiated flows. For API clients it +either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the +form is invalid and a HTTP 302 Found redirect with a fresh verification flow if +the flow was otherwise invalid (e.g. expired). For Browser clients it returns a +HTTP 302 Found redirect to the Verification UI URL with the Verification Flow ID +appended. `sent_email` is the success state after `choose_method` and allows the +user to request another verification email. It works for both API and +Browser-initiated flows and returns the same responses as the flow in +`choose_method` state. `passed_challenge` expects a `token` to be sent in the +URL query and given the nature of the flow ("sending a verification link") does +not have any API capabilities. The server responds with a HTTP 302 Found +redirect either to the Settings UI URL (if the link was valid) and instructs the +user to update their password, or a redirect to the Verification UI URL with a +new Verification Flow ID which contains an error message that the verification +link was invalid. -More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). +More information can be found at +[ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). #### Request body @@ -7606,25 +7642,24 @@ More information can be found at [ORY Kratos Email and Phone Verification Docume ```yaml csrf_token: string email: string - ``` #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|token|query|string|false|Verification Token| -|flow|query|string|false|The Flow ID| -|body|body|[completeSelfServiceVerificationFlowWithLinkMethod](#schemacompleteselfserviceverificationflowwithlinkmethod)|false|none| +| Parameter | In | Type | Required | Description | +| --------- | ----- | ------------------------------------------------------------------------------------------------------------- | -------- | ------------------ | +| token | query | string | false | Verification Token | +| flow | query | string | false | The Flow ID | +| body | body | [completeSelfServiceVerificationFlowWithLinkMethod](#schemacompleteselfserviceverificationflowwithlinkmethod) | false | none | ##### Detailed descriptions **token**: Verification Token -The verification token which completes the verification request. If the token -is invalid (e.g. expired) an error will be shown to the end-user. +The verification token which completes the verification request. If the token is +invalid (e.g. expired) an error will be shown to the end-user. **flow**: The Flow ID @@ -7636,12 +7671,12 @@ format: uuid ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|302|[Found](https://tools.ietf.org/html/rfc7231#section-6.4.3)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|verificationFlow|[verificationFlow](#schemaverificationflow)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | +| 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | verificationFlow | [verificationFlow](#schemaverificationflow) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -7735,9 +7770,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -7763,7 +7796,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, } @@ -7881,10 +7914,12 @@ Accept: application/json ``` -Use this endpoint to revoke a session using its token. This endpoint is particularly useful for API clients -such as mobile apps to log the user out of the system and invalidate the session. +Use this endpoint to revoke a session using its token. This endpoint is +particularly useful for API clients such as mobile apps to log the user out of +the system and invalidate the session. -This endpoint does not remove any HTTP Cookies - use the Self-Service Logout Flow instead. +This endpoint does not remove any HTTP Cookies - use the Self-Service Logout +Flow instead. #### Request body @@ -7898,9 +7933,9 @@ This endpoint does not remove any HTTP Cookies - use the Self-Service Logout Flo #### Parameters -|Parameter|In|Type|Required|Description| -|---|---|---|---|---| -|body|body|[revokeSession](#schemarevokesession)|true|none| +| Parameter | In | Type | Required | Description | +| --------- | ---- | ------------------------------------- | -------- | ----------- | +| body | body | [revokeSession](#schemarevokesession) | true | none | #### Responses @@ -7908,12 +7943,12 @@ This endpoint does not remove any HTTP Cookies - use the Self-Service Logout Flo ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is -typically 201.|None| -|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| -------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is | +| typically 201. | None | +| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -7933,9 +7968,7 @@ typically 201.|None| } ``` - + #### Code samples @@ -7961,7 +7994,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, } @@ -8077,9 +8110,11 @@ Accept: application/json ``` -Uses the HTTP Headers in the GET request to determine (e.g. by using checking the cookies) who is authenticated. -Returns a session object in the body or 401 if the credentials are invalid or no credentials were sent. -Additionally when the request it successful it adds the user ID to the 'X-Kratos-Authenticated-Identity-Id' header in the response. +Uses the HTTP Headers in the GET request to determine (e.g. by using checking +the cookies) who is authenticated. Returns a session object in the body or 401 +if the credentials are invalid or no credentials were sent. Additionally when +the request it successful it adds the user ID to the +'X-Kratos-Authenticated-Identity-Id' header in the response. This endpoint is useful for reverse proxies and API Gateways. @@ -8089,11 +8124,11 @@ This endpoint is useful for reverse proxies and API Gateways. ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|session|[session](#schemasession)| -|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|genericError|[genericError](#schemagenericerror)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|genericError|[genericError](#schemagenericerror)| +| Status | Meaning | Description | Schema | +| ------ | -------------------------------------------------------------------------- | ------------ | ----------------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | session | [session](#schemasession) | +| 403 | [Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) | genericError | [genericError](#schemagenericerror) | +| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | genericError | [genericError](#schemagenericerror) | ##### Examples @@ -8132,9 +8167,7 @@ This endpoint is useful for reverse proxies and API Gateways. } ``` - + #### Code samples @@ -8160,7 +8193,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -8180,20 +8213,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/sessions/whoami', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -8274,13 +8307,14 @@ Accept: application/json ``` -This endpoint returns the service version typically notated using semantic versioning. +This endpoint returns the service version typically notated using semantic +versioning. 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. +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. #### Responses @@ -8288,9 +8322,9 @@ refer to the cluster state, only to a single instance. ##### Overview -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|version|[version](#schemaversion)| +| Status | Meaning | Description | Schema | +| ------ | ------------------------------------------------------- | ----------- | ------------------------- | +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | version | [version](#schemaversion) | ##### Examples @@ -8302,9 +8336,7 @@ refer to the cluster state, only to a single instance. } ``` - + #### Code samples @@ -8330,7 +8362,7 @@ import ( ) func main() { - headers := map[string][]string{ + headers := map[string][]string{ "Accept": []string{"application/json"}, } @@ -8350,20 +8382,20 @@ func main() { ```javascript -const fetch = require('node-fetch'); +const fetch = require('node-fetch') const headers = { - 'Accept': 'application/json' + Accept: 'application/json' } fetch('/version', { method: 'GET', headers }) -.then(r => r.json()) -.then((body) => { + .then((r) => r.json()) + .then((body) => { console.log(body) -}) + }) ``` @@ -8443,15 +8475,14 @@ p JSON.parse(result) "csrf_token": "string", "password": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|csrf_token|string|false|none|CSRFToken is the anti-CSRF token

type: string| -|password|string|true|none|Password is the updated password

type: string| +| Name | Type | Required | Restrictions | Description | +| ---------- | ------ | -------- | ------------ | ---------------------------------------------------- | +| csrf_token | string | false | none | CSRFToken is the anti-CSRF token

type: string | +| password | string | true | none | Password is the updated password

type: string | @@ -8464,15 +8495,14 @@ p JSON.parse(result) "schema_id": "string", "traits": {} } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|schema_id|string|true|none|SchemaID is the ID of the JSON Schema to be used for validating the identity's traits.| -|traits|object|true|none|Traits represent an identity's traits. The identity is able to create, modify, and delete traits
in a self-service manner. The input will always be validated against the JSON Schema defined
in `schema_url`.| +| Name | Type | Required | Restrictions | Description | +| --------- | ------ | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| schema_id | string | true | none | SchemaID is the ID of the JSON Schema to be used for validating the identity's traits. | +| traits | object | true | none | Traits represent an identity's traits. The identity is able to create, modify, and delete traits
in a self-service manner. The input will always be validated against the JSON Schema defined
in `schema_url`. | @@ -8485,15 +8515,14 @@ p JSON.parse(result) "expires_in": "string", "identity_id": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|expires_in|string|false|none|Link Expires In

The recovery link will expire at that point in time. Defaults to the configuration value of
`selfservice.flows.recovery.request_lifespan`.| -|identity_id|[UUID](#schemauuid)|true|none|none| +| Name | Type | Required | Restrictions | Description | +| ----------- | ------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| expires_in | string | false | none | Link Expires In

The recovery link will expire at that point in time. Defaults to the configuration value of
`selfservice.flows.recovery.request_lifespan`. | +| identity_id | [UUID](#schemauuid) | true | none | none | @@ -8503,16 +8532,16 @@ p JSON.parse(result) ```json "string" - ``` -*CredentialsType represents several different credential types, like password credentials, passwordless credentials,* +_CredentialsType represents several different credential types, like password +credentials, passwordless credentials,_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|CredentialsType represents several different credential types, like password credentials, passwordless credentials,|string|false|none|and so on.| +| Name | Type | Required | Restrictions | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------ | -------- | ------------ | ----------- | +| CredentialsType represents several different credential types, like password credentials, passwordless credentials, | string | false | none | and so on. | @@ -8551,17 +8580,16 @@ p JSON.parse(result) ], "method": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|action|string|true|none|Action should be used as the form action URL `
`.| -|fields|[formFields](#schemaformfields)|true|none|Fields contains multiple fields| -|messages|[Messages](#schemamessages)|false|none|none| -|method|string|true|none|Method is the form method (e.g. POST)| +| Name | Type | Required | Restrictions | Description | +| -------- | ------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +| action | string | true | none | Action should be used as the form action URL ``. | +| fields | [formFields](#schemaformfields) | true | none | Fields contains multiple fields | +| messages | [Messages](#schemamessages) | false | none | none | +| method | string | true | none | Method is the form method (e.g. POST) | @@ -8571,14 +8599,13 @@ p JSON.parse(result) ```json 0 - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|integer(int64)|false|none|none| +| Name | Type | Required | Restrictions | Description | +| ----------- | -------------- | -------- | ------------ | ----------- | +| _anonymous_ | integer(int64) | false | none | none | @@ -8610,19 +8637,18 @@ p JSON.parse(result) } ] } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|id|[UUID](#schemauuid)|true|none|none| -|recovery_addresses|[[RecoveryAddress](#schemarecoveryaddress)]|false|none|RecoveryAddresses contains all the addresses that can be used to recover an identity.| -|schema_id|string|true|none|SchemaID is the ID of the JSON Schema to be used for validating the identity's traits.| -|schema_url|string|false|none|SchemaURL is the URL of the endpoint where the identity's traits schema can be fetched from.

format: url| -|traits|[Traits](#schematraits)|true|none|none| -|verifiable_addresses|[[VerifiableAddress](#schemaverifiableaddress)]|false|none|VerifiableAddresses contains all the addresses that can be verified by the user.| +| Name | Type | Required | Restrictions | Description | +| -------------------- | ----------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------- | +| id | [UUID](#schemauuid) | true | none | none | +| recovery_addresses | [[RecoveryAddress](#schemarecoveryaddress)] | false | none | RecoveryAddresses contains all the addresses that can be used to recover an identity. | +| schema_id | string | true | none | SchemaID is the ID of the JSON Schema to be used for validating the identity's traits. | +| schema_url | string | false | none | SchemaURL is the URL of the endpoint where the identity's traits schema can be fetched from.

format: url | +| traits | [Traits](#schematraits) | true | none | none | +| verifiable_addresses | [[VerifiableAddress](#schemaverifiableaddress)] | false | none | VerifiableAddresses contains all the addresses that can be verified by the user. | @@ -8637,17 +8663,16 @@ p JSON.parse(result) "text": "string", "type": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|context|object|false|none|none| -|id|[ID](#schemaid)|false|none|none| -|text|string|false|none|none| -|type|[Type](#schematype)|false|none|The flow type can either be `api` or `browser`.| +| Name | Type | Required | Restrictions | Description | +| ------- | ------------------- | -------- | ------------ | ----------------------------------------------- | +| context | object | false | none | none | +| id | [ID](#schemaid) | false | none | none | +| text | string | false | none | none | +| type | [Type](#schematype) | false | none | The flow type can either be `api` or `browser`. | @@ -8664,14 +8689,13 @@ p JSON.parse(result) "type": "string" } ] - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|[[Message](#schemamessage)]|false|none|none| +| Name | Type | Required | Restrictions | Description | +| ----------- | --------------------------- | -------- | ------------ | ----------- | +| _anonymous_ | [[Message](#schemamessage)] | false | none | none | @@ -8681,16 +8705,15 @@ p JSON.parse(result) ```json "2019-08-24T14:15:22Z" - ``` -*NullTime implements sql.NullTime functionality.* +_NullTime implements sql.NullTime functionality._ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|NullTime implements sql.NullTime functionality.|string(date-time)|false|none|none| +| Name | Type | Required | Restrictions | Description | +| ----------------------------------------------- | ----------------- | -------- | ------------ | ----------- | +| NullTime implements sql.NullTime functionality. | string(date-time) | false | none | none | @@ -8704,16 +8727,15 @@ p JSON.parse(result) "value": "string", "via": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|id|[UUID](#schemauuid)|true|none|none| -|value|string|true|none|none| -|via|[RecoveryAddressType](#schemarecoveryaddresstype)|true|none|none| +| Name | Type | Required | Restrictions | Description | +| ----- | ------------------------------------------------- | -------- | ------------ | ----------- | +| id | [UUID](#schemauuid) | true | none | none | +| value | string | true | none | none | +| via | [RecoveryAddressType](#schemarecoveryaddresstype) | true | none | none | @@ -8723,14 +8745,13 @@ p JSON.parse(result) ```json "string" - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|string|false|none|none| +| Name | Type | Required | Restrictions | Description | +| ----------- | ------ | -------- | ------------ | ----------- | +| _anonymous_ | string | false | none | none | @@ -8740,14 +8761,13 @@ p JSON.parse(result) ```json "string" - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|string|false|none|none| +| Name | Type | Required | Restrictions | Description | +| ----------- | ------ | -------- | ------------ | ----------- | +| _anonymous_ | string | false | none | none | @@ -8757,12 +8777,11 @@ p JSON.parse(result) ```json {} - ``` #### Properties -*None* +_None_ @@ -8772,16 +8791,15 @@ p JSON.parse(result) ```json "string" - ``` -*Type is the flow type.* +_Type is the flow type._ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|Type is the flow type.|string|false|none|The flow type can either be `api` or `browser`.| +| Name | Type | Required | Restrictions | Description | +| ---------------------- | ------ | -------- | ------------ | ----------------------------------------------- | +| Type is the flow type. | string | false | none | The flow type can either be `api` or `browser`. | @@ -8791,14 +8809,13 @@ p JSON.parse(result) ```json "string" - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|string(uuid4)|false|none|none| +| Name | Type | Required | Restrictions | Description | +| ----------- | ------------- | -------- | ------------ | ----------- | +| _anonymous_ | string(uuid4) | false | none | none | @@ -8811,15 +8828,14 @@ p JSON.parse(result) "schema_id": "string", "traits": {} } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|schema_id|string|false|none|SchemaID is the ID of the JSON Schema to be used for validating the identity's traits. If set
will update the Identity's SchemaID.| -|traits|object|true|none|Traits represent an identity's traits. The identity is able to create, modify, and delete traits
in a self-service manner. The input will always be validated against the JSON Schema defined
in `schema_id`.| +| Name | Type | Required | Restrictions | Description | +| --------- | ------ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| schema_id | string | false | none | SchemaID is the ID of the JSON Schema to be used for validating the identity's traits. If set
will update the Identity's SchemaID. | +| traits | object | true | none | Traits represent an identity's traits. The identity is able to create, modify, and delete traits
in a self-service manner. The input will always be validated against the JSON Schema defined
in `schema_id`. | @@ -8836,19 +8852,18 @@ p JSON.parse(result) "verified_at": "2019-08-24T14:15:22Z", "via": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|id|[UUID](#schemauuid)|true|none|none| -|status|[VerifiableAddressStatus](#schemaverifiableaddressstatus)|true|none|none| -|value|string|true|none|none| -|verified|boolean|true|none|none| -|verified_at|[NullTime](#schemanulltime)|false|none|none| -|via|[VerifiableAddressType](#schemaverifiableaddresstype)|true|none|none| +| Name | Type | Required | Restrictions | Description | +| ----------- | --------------------------------------------------------- | -------- | ------------ | ----------- | +| id | [UUID](#schemauuid) | true | none | none | +| status | [VerifiableAddressStatus](#schemaverifiableaddressstatus) | true | none | none | +| value | string | true | none | none | +| verified | boolean | true | none | none | +| verified_at | [NullTime](#schemanulltime) | false | none | none | +| via | [VerifiableAddressType](#schemaverifiableaddresstype) | true | none | none | @@ -8858,14 +8873,13 @@ p JSON.parse(result) ```json "string" - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|string|false|none|none| +| Name | Type | Required | Restrictions | Description | +| ----------- | ------ | -------- | ------------ | ----------- | +| _anonymous_ | string | false | none | none | @@ -8875,14 +8889,13 @@ p JSON.parse(result) ```json "string" - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|string|false|none|none| +| Name | Type | Required | Restrictions | Description | +| ----------- | ------ | -------- | ------------ | ----------- | +| _anonymous_ | string | false | none | none | @@ -8895,15 +8908,14 @@ p JSON.parse(result) "csrf_token": "string", "email": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|csrf_token|string|false|none|Sending the anti-csrf token is only required for browser login flows.| -|email|string|false|none|Email to Recover

Needs to be set when initiating the flow. If the email is a registered
recovery email, a recovery link will be sent. If the email is not known,
a email with details on what happened will be sent instead.

format: email
in: body| +| Name | Type | Required | Restrictions | Description | +| ---------- | ------ | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| csrf_token | string | false | none | Sending the anti-csrf token is only required for browser login flows. | +| email | string | false | none | Email to Recover

Needs to be set when initiating the flow. If the email is a registered
recovery email, a recovery link will be sent. If the email is not known,
a email with details on what happened will be sent instead.

format: email
in: body | @@ -8916,15 +8928,14 @@ p JSON.parse(result) "csrf_token": "string", "email": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|csrf_token|string|false|none|Sending the anti-csrf token is only required for browser login flows.| -|email|string|false|none|Email to Verify

Needs to be set when initiating the flow. If the email is a registered
verification email, a verification link will be sent. If the email is not known,
a email with details on what happened will be sent instead.

format: email
in: body| +| Name | Type | Required | Restrictions | Description | +| ---------- | ------ | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| csrf_token | string | false | none | Sending the anti-csrf token is only required for browser login flows. | +| email | string | false | none | Email to Verify

Needs to be set when initiating the flow. If the email is a registered
verification email, a verification link will be sent. If the email is not known,
a email with details on what happened will be sent instead.

format: email
in: body | @@ -8937,15 +8948,14 @@ p JSON.parse(result) "errors": {}, "id": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|errors|object|true|none|Errors in the container| -|id|[UUID](#schemauuid)|true|none|none| +| Name | Type | Required | Restrictions | Description | +| ------ | ------------------- | -------- | ------------ | ----------------------- | +| errors | object | true | none | Errors in the container | +| id | [UUID](#schemauuid) | true | none | none | @@ -8970,22 +8980,21 @@ p JSON.parse(result) "type": "string", "value": {} } - ``` -*Field represents a HTML Form Field* +_Field represents a HTML Form Field_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|disabled|boolean|false|none|Disabled is the equivalent of ``| -|messages|[Messages](#schemamessages)|false|none|none| -|name|string|true|none|Name is the equivalent of ``| -|pattern|string|false|none|Pattern is the equivalent of ``| -|required|boolean|false|none|Required is the equivalent of ``| -|type|string|true|none|Type is the equivalent of ``| -|value|object|false|none|Value is the equivalent of ``| +| Name | Type | Required | Restrictions | Description | +| -------- | --------------------------- | -------- | ------------ | ------------------------------------------------------------------------ | +| disabled | boolean | false | none | Disabled is the equivalent of `` | +| messages | [Messages](#schemamessages) | false | none | none | +| name | string | true | none | Name is the equivalent of `` | +| pattern | string | false | none | Pattern is the equivalent of `` | +| required | boolean | false | none | Required is the equivalent of `` | +| type | string | true | none | Type is the equivalent of `` | +| value | object | false | none | Value is the equivalent of `` | @@ -9012,16 +9021,15 @@ p JSON.parse(result) "value": {} } ] - ``` -*Fields contains multiple fields* +_Fields contains multiple fields_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|[[formField](#schemaformfield)]|false|none|Fields contains multiple fields| +| Name | Type | Required | Restrictions | Description | +| ----------- | ------------------------------- | -------- | ------------ | ------------------------------- | +| _anonymous_ | [[formField](#schemaformfield)] | false | none | Fields contains multiple fields | @@ -9041,16 +9049,15 @@ p JSON.parse(result) "status": "string" } } - ``` -*Error response* +_Error response_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|error|[genericErrorPayload](#schemagenericerrorpayload)|false|none|none| +| Name | Type | Required | Restrictions | Description | +| ----- | ------------------------------------------------- | -------- | ------------ | ----------- | +| error | [genericErrorPayload](#schemagenericerrorpayload) | false | none | none | @@ -9068,20 +9075,19 @@ p JSON.parse(result) "request": "string", "status": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|code|integer(int64)|false|none|Code represents the error status code (404, 403, 401, ...).| -|debug|string|false|none|Debug contains debug information. This is usually not available and has to be enabled.| -|details|object|false|none|none| -|message|string|false|none|none| -|reason|string|false|none|none| -|request|string|false|none|none| -|status|string|false|none|none| +| Name | Type | Required | Restrictions | Description | +| ------- | -------------- | -------- | ------------ | -------------------------------------------------------------------------------------- | +| code | integer(int64) | false | none | Code represents the error status code (404, 403, 401, ...). | +| debug | string | false | none | Debug contains debug information. This is usually not available and has to be enabled. | +| details | object | false | none | none | +| message | string | false | none | none | +| reason | string | false | none | none | +| request | string | false | none | none | +| status | string | false | none | none | @@ -9096,15 +9102,14 @@ p JSON.parse(result) "property2": "string" } } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|errors|object|false|none|Errors contains a list of errors that caused the not ready status.| -|» **additionalProperties**|string|false|none|none| +| Name | Type | Required | Restrictions | Description | +| -------------------------- | ------ | -------- | ------------ | ------------------------------------------------------------------ | +| errors | object | false | none | Errors contains a list of errors that caused the not ready status. | +| » **additionalProperties** | string | false | none | none | @@ -9116,14 +9121,13 @@ p JSON.parse(result) { "status": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|status|string|false|none|Status always contains "ok".| +| Name | Type | Required | Restrictions | Description | +| ------ | ------ | -------- | ------------ | ---------------------------- | +| status | string | false | none | Status always contains "ok". | @@ -9253,25 +9257,24 @@ p JSON.parse(result) "request_url": "string", "type": "string" } - ``` -*Login Flow* +_Login Flow_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|active|[CredentialsType](#schemacredentialstype)|false|none|and so on.| -|expires_at|string(date-time)|true|none|ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to log in,
a new flow has to be initiated.| -|forced|boolean|false|none|Forced stores whether this login flow should enforce re-authentication.| -|id|[UUID](#schemauuid)|true|none|none| -|issued_at|string(date-time)|true|none|IssuedAt is the time (UTC) when the flow started.| -|messages|[Messages](#schemamessages)|false|none|none| -|methods|object|true|none|List of login methods

This is the list of available login methods with their required form fields, such as `identifier` and `password`
for the password login method. This will also contain error messages such as "password can not be empty".| -|» **additionalProperties**|[loginFlowMethod](#schemaloginflowmethod)|false|none|none| -|request_url|string|true|none|RequestURL is the initial URL that was requested from ORY Kratos. It can be used
to forward information contained in the URL's path or query for example.| -|type|[Type](#schematype)|false|none|The flow type can either be `api` or `browser`.| +| Name | Type | Required | Restrictions | Description | +| -------------------------- | ----------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| active | [CredentialsType](#schemacredentialstype) | false | none | and so on. | +| expires_at | string(date-time) | true | none | ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to log in,
a new flow has to be initiated. | +| forced | boolean | false | none | Forced stores whether this login flow should enforce re-authentication. | +| id | [UUID](#schemauuid) | true | none | none | +| issued_at | string(date-time) | true | none | IssuedAt is the time (UTC) when the flow started. | +| messages | [Messages](#schemamessages) | false | none | none | +| methods | object | true | none | List of login methods

This is the list of available login methods with their required form fields, such as `identifier` and `password`
for the password login method. This will also contain error messages such as "password can not be empty". | +| » **additionalProperties** | [loginFlowMethod](#schemaloginflowmethod) | false | none | none | +| request_url | string | true | none | RequestURL is the initial URL that was requested from ORY Kratos. It can be used
to forward information contained in the URL's path or query for example. | +| type | [Type](#schematype) | false | none | The flow type can either be `api` or `browser`. | @@ -9331,15 +9334,14 @@ p JSON.parse(result) }, "method": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|config|[loginFlowMethodConfig](#schemaloginflowmethodconfig)|true|none|none| -|method|[CredentialsType](#schemacredentialstype)|true|none|and so on.| +| Name | Type | Required | Restrictions | Description | +| ------ | ----------------------------------------------------- | -------- | ------------ | ----------- | +| config | [loginFlowMethodConfig](#schemaloginflowmethodconfig) | true | none | none | +| method | [CredentialsType](#schemacredentialstype) | true | none | and so on. | @@ -9396,18 +9398,17 @@ p JSON.parse(result) } ] } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|action|string|true|none|Action should be used as the form action URL ``.| -|fields|[formFields](#schemaformfields)|true|none|Fields contains multiple fields| -|messages|[Messages](#schemamessages)|false|none|none| -|method|string|true|none|Method is the form method (e.g. POST)| -|providers|[[formField](#schemaformfield)]|false|none|Providers is set for the "oidc" flow method.| +| Name | Type | Required | Restrictions | Description | +| --------- | ------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +| action | string | true | none | Action should be used as the form action URL ``. | +| fields | [formFields](#schemaformfields) | true | none | Fields contains multiple fields | +| messages | [Messages](#schemamessages) | false | none | none | +| method | string | true | none | Method is the form method (e.g. POST) | +| providers | [[formField](#schemaformfield)] | false | none | Providers is set for the "oidc" flow method. | @@ -9449,17 +9450,16 @@ p JSON.parse(result) }, "session_token": "string" } - ``` -*The Response for Login Flows via API* +_The Response for Login Flows via API_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|session|[session](#schemasession)|true|none|none| -|session_token|string|true|none|The Session Token

A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization
Header:

Authorization: bearer

The session token is only issued for API flows, not for Browser flows!| +| Name | Type | Required | Restrictions | Description | +| ------------- | ------------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| session | [session](#schemasession) | true | none | none | +| session_token | string | true | none | The Session Token

A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization
Header:

Authorization: bearer

The session token is only issued for API flows, not for Browser flows! | @@ -9553,25 +9553,24 @@ p JSON.parse(result) "state": "string", "type": "string" } - ``` -*A Recovery Flow* +_A Recovery Flow_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|active|string|false|none|Active, if set, contains the registration method that is being used. It is initially
not set.| -|expires_at|string(date-time)|true|none|ExpiresAt is the time (UTC) when the request expires. If the user still wishes to update the setting,
a new request has to be initiated.| -|id|[UUID](#schemauuid)|true|none|none| -|issued_at|string(date-time)|true|none|IssuedAt is the time (UTC) when the request occurred.| -|messages|[Messages](#schemamessages)|false|none|none| -|methods|object|true|none|Methods contains context for all account recovery methods. If a registration request has been
processed, but for example the password is incorrect, this will contain error messages.| -|» **additionalProperties**|[recoveryFlowMethod](#schemarecoveryflowmethod)|false|none|none| -|request_url|string|true|none|RequestURL is the initial URL that was requested from ORY Kratos. It can be used
to forward information contained in the URL's path or query for example.| -|state|[State](#schemastate)|true|none|none| -|type|[Type](#schematype)|false|none|The flow type can either be `api` or `browser`.| +| Name | Type | Required | Restrictions | Description | +| -------------------------- | ----------------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| active | string | false | none | Active, if set, contains the registration method that is being used. It is initially
not set. | +| expires_at | string(date-time) | true | none | ExpiresAt is the time (UTC) when the request expires. If the user still wishes to update the setting,
a new request has to be initiated. | +| id | [UUID](#schemauuid) | true | none | none | +| issued_at | string(date-time) | true | none | IssuedAt is the time (UTC) when the request occurred. | +| messages | [Messages](#schemamessages) | false | none | none | +| methods | object | true | none | Methods contains context for all account recovery methods. If a registration request has been
processed, but for example the password is incorrect, this will contain error messages. | +| » **additionalProperties** | [recoveryFlowMethod](#schemarecoveryflowmethod) | false | none | none | +| request_url | string | true | none | RequestURL is the initial URL that was requested from ORY Kratos. It can be used
to forward information contained in the URL's path or query for example. | +| state | [State](#schemastate) | true | none | none | +| type | [Type](#schematype) | false | none | The flow type can either be `api` or `browser`. | @@ -9613,15 +9612,14 @@ p JSON.parse(result) }, "method": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|config|[recoveryFlowMethodConfig](#schemarecoveryflowmethodconfig)|false|none|none| -|method|string|false|none|Method contains the request credentials type.| +| Name | Type | Required | Restrictions | Description | +| ------ | ----------------------------------------------------------- | -------- | ------------ | --------------------------------------------- | +| config | [recoveryFlowMethodConfig](#schemarecoveryflowmethodconfig) | false | none | none | +| method | string | false | none | Method contains the request credentials type. | @@ -9660,17 +9658,16 @@ p JSON.parse(result) ], "method": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|action|string|true|none|Action should be used as the form action URL ``.| -|fields|[formFields](#schemaformfields)|true|none|Fields contains multiple fields| -|messages|[Messages](#schemamessages)|false|none|none| -|method|string|true|none|Method is the form method (e.g. POST)| +| Name | Type | Required | Restrictions | Description | +| -------- | ------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +| action | string | true | none | Action should be used as the form action URL ``. | +| fields | [formFields](#schemaformfields) | true | none | Fields contains multiple fields | +| messages | [Messages](#schemamessages) | false | none | none | +| method | string | true | none | Method is the form method (e.g. POST) | @@ -9683,15 +9680,14 @@ p JSON.parse(result) "expires_at": "2019-08-24T14:15:22Z", "recovery_link": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|expires_at|string(date-time)|false|none|Recovery Link Expires At

The timestamp when the recovery link expires.| -|recovery_link|string|true|none|Recovery Link

This link can be used to recover the account.| +| Name | Type | Required | Restrictions | Description | +| ------------- | ----------------- | -------- | ------------ | ----------------------------------------------------------------------------- | +| expires_at | string(date-time) | false | none | Recovery Link Expires At

The timestamp when the recovery link expires. | +| recovery_link | string | true | none | Recovery Link

This link can be used to recover the account. | @@ -9820,22 +9816,21 @@ p JSON.parse(result) "request_url": "string", "type": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|active|[CredentialsType](#schemacredentialstype)|false|none|and so on.| -|expires_at|string(date-time)|true|none|ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to log in,
a new flow has to be initiated.| -|id|[UUID](#schemauuid)|true|none|none| -|issued_at|string(date-time)|true|none|IssuedAt is the time (UTC) when the flow occurred.| -|messages|[Messages](#schemamessages)|false|none|none| -|methods|object|true|none|Methods contains context for all enabled registration methods. If a registration flow has been
processed, but for example the password is incorrect, this will contain error messages.| -|» **additionalProperties**|[registrationFlowMethod](#schemaregistrationflowmethod)|false|none|none| -|request_url|string|true|none|RequestURL is the initial URL that was requested from ORY Kratos. It can be used
to forward information contained in the URL's path or query for example.| -|type|[Type](#schematype)|false|none|The flow type can either be `api` or `browser`.| +| Name | Type | Required | Restrictions | Description | +| -------------------------- | ------------------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| active | [CredentialsType](#schemacredentialstype) | false | none | and so on. | +| expires_at | string(date-time) | true | none | ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to log in,
a new flow has to be initiated. | +| id | [UUID](#schemauuid) | true | none | none | +| issued_at | string(date-time) | true | none | IssuedAt is the time (UTC) when the flow occurred. | +| messages | [Messages](#schemamessages) | false | none | none | +| methods | object | true | none | Methods contains context for all enabled registration methods. If a registration flow has been
processed, but for example the password is incorrect, this will contain error messages. | +| » **additionalProperties** | [registrationFlowMethod](#schemaregistrationflowmethod) | false | none | none | +| request_url | string | true | none | RequestURL is the initial URL that was requested from ORY Kratos. It can be used
to forward information contained in the URL's path or query for example. | +| type | [Type](#schematype) | false | none | The flow type can either be `api` or `browser`. | @@ -9895,15 +9890,14 @@ p JSON.parse(result) }, "method": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|config|[registrationFlowMethodConfig](#schemaregistrationflowmethodconfig)|false|none|none| -|method|[CredentialsType](#schemacredentialstype)|false|none|and so on.| +| Name | Type | Required | Restrictions | Description | +| ------ | ------------------------------------------------------------------- | -------- | ------------ | ----------- | +| config | [registrationFlowMethodConfig](#schemaregistrationflowmethodconfig) | false | none | none | +| method | [CredentialsType](#schemacredentialstype) | false | none | and so on. | @@ -9960,18 +9954,17 @@ p JSON.parse(result) } ] } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|action|string|true|none|Action should be used as the form action URL ``.| -|fields|[formFields](#schemaformfields)|true|none|Fields contains multiple fields| -|messages|[Messages](#schemamessages)|false|none|none| -|method|string|true|none|Method is the form method (e.g. POST)| -|providers|[[formField](#schemaformfield)]|false|none|Providers is set for the "oidc" registration method.| +| Name | Type | Required | Restrictions | Description | +| --------- | ------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +| action | string | true | none | Action should be used as the form action URL ``. | +| fields | [formFields](#schemaformfields) | true | none | Fields contains multiple fields | +| messages | [Messages](#schemamessages) | false | none | none | +| method | string | true | none | Method is the form method (e.g. POST) | +| providers | [[formField](#schemaformfield)] | false | none | Providers is set for the "oidc" registration method. | @@ -10036,18 +10029,17 @@ p JSON.parse(result) }, "session_token": "string" } - ``` -*The Response for Registration Flows via API* +_The Response for Registration Flows via API_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|identity|[Identity](#schemaidentity)|true|none|none| -|session|[session](#schemasession)|false|none|none| -|session_token|string|true|none|The Session Token

This field is only set when the session hook is configured as a post-registration hook.

A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization
Header:

Authorization: bearer

The session token is only issued for API flows, not for Browser flows!| +| Name | Type | Required | Restrictions | Description | +| ------------- | --------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| identity | [Identity](#schemaidentity) | true | none | none | +| session | [session](#schemasession) | false | none | none | +| session_token | string | true | none | The Session Token

This field is only set when the session hook is configured as a post-registration hook.

A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization
Header:

Authorization: bearer

The session token is only issued for API flows, not for Browser flows! | @@ -10059,14 +10051,13 @@ p JSON.parse(result) { "session_token": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|session_token|string|true|none|The Session Token

Invalidate this session token.| +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ------------------------------------------------------- | +| session_token | string | true | none | The Session Token

Invalidate this session token. | @@ -10105,19 +10096,18 @@ p JSON.parse(result) }, "issued_at": "2019-08-24T14:15:22Z" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|active|boolean|false|none|none| -|authenticated_at|string(date-time)|true|none|none| -|expires_at|string(date-time)|true|none|none| -|id|[UUID](#schemauuid)|true|none|none| -|identity|[Identity](#schemaidentity)|true|none|none| -|issued_at|string(date-time)|true|none|none| +| Name | Type | Required | Restrictions | Description | +| ---------------- | --------------------------- | -------- | ------------ | ----------- | +| active | boolean | false | none | none | +| authenticated_at | string(date-time) | true | none | none | +| expires_at | string(date-time) | true | none | none | +| id | [UUID](#schemauuid) | true | none | none | +| identity | [Identity](#schemaidentity) | true | none | none | +| issued_at | string(date-time) | true | none | none | @@ -10234,26 +10224,25 @@ p JSON.parse(result) "state": "string", "type": "string" } - ``` -*Flow represents a Settings Flow* +_Flow represents a Settings Flow_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|active|string|false|none|Active, if set, contains the registration method that is being used. It is initially
not set.| -|expires_at|string(date-time)|true|none|ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to update the setting,
a new flow has to be initiated.| -|id|[UUID](#schemauuid)|true|none|none| -|identity|[Identity](#schemaidentity)|true|none|none| -|issued_at|string(date-time)|true|none|IssuedAt is the time (UTC) when the flow occurred.| -|messages|[Messages](#schemamessages)|false|none|none| -|methods|object|true|none|Methods contains context for all enabled registration methods. If a settings flow has been
processed, but for example the first name is empty, this will contain error messages.| -|» **additionalProperties**|[settingsFlowMethod](#schemasettingsflowmethod)|false|none|none| -|request_url|string|true|none|RequestURL is the initial URL that was requested from ORY Kratos. It can be used
to forward information contained in the URL's path or query for example.| -|state|[State](#schemastate)|true|none|none| -|type|[Type](#schematype)|false|none|The flow type can either be `api` or `browser`.| +| Name | Type | Required | Restrictions | Description | +| -------------------------- | ----------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| active | string | false | none | Active, if set, contains the registration method that is being used. It is initially
not set. | +| expires_at | string(date-time) | true | none | ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to update the setting,
a new flow has to be initiated. | +| id | [UUID](#schemauuid) | true | none | none | +| identity | [Identity](#schemaidentity) | true | none | none | +| issued_at | string(date-time) | true | none | IssuedAt is the time (UTC) when the flow occurred. | +| messages | [Messages](#schemamessages) | false | none | none | +| methods | object | true | none | Methods contains context for all enabled registration methods. If a settings flow has been
processed, but for example the first name is empty, this will contain error messages. | +| » **additionalProperties** | [settingsFlowMethod](#schemasettingsflowmethod) | false | none | none | +| request_url | string | true | none | RequestURL is the initial URL that was requested from ORY Kratos. It can be used
to forward information contained in the URL's path or query for example. | +| state | [State](#schemastate) | true | none | none | +| type | [Type](#schematype) | false | none | The flow type can either be `api` or `browser`. | @@ -10295,15 +10284,14 @@ p JSON.parse(result) }, "method": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|config|[FlowMethodConfig](#schemaflowmethodconfig)|false|none|none| -|method|string|false|none|Method is the name of this flow method.| +| Name | Type | Required | Restrictions | Description | +| ------ | ------------------------------------------- | -------- | ------------ | --------------------------------------- | +| config | [FlowMethodConfig](#schemaflowmethodconfig) | false | none | none | +| method | string | false | none | Method is the name of this flow method. | @@ -10445,17 +10433,16 @@ p JSON.parse(result) ] } } - ``` -*The Response for Settings Flows via API* +_The Response for Settings Flows via API_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|flow|[settingsFlow](#schemasettingsflow)|true|none|This flow is used when an identity wants to update settings
(e.g. profile data, passwords, ...) in a selfservice manner.

We recommend reading the [User Settings Documentation](../self-service/flows/user-settings)| -|identity|[Identity](#schemaidentity)|true|none|none| +| Name | Type | Required | Restrictions | Description | +| -------- | ----------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| flow | [settingsFlow](#schemasettingsflow) | true | none | This flow is used when an identity wants to update settings
(e.g. profile data, passwords, ...) in a selfservice manner.

We recommend reading the [User Settings Documentation](../self-service/flows/user-settings) | +| identity | [Identity](#schemaidentity) | true | none | none | @@ -10549,25 +10536,24 @@ p JSON.parse(result) "state": "string", "type": "string" } - ``` -*A Verification Flow* +_A Verification Flow_ #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|active|string|false|none|Active, if set, contains the registration method that is being used. It is initially
not set.| -|expires_at|string(date-time)|false|none|ExpiresAt is the time (UTC) when the request expires. If the user still wishes to verify the address,
a new request has to be initiated.| -|id|[UUID](#schemauuid)|false|none|none| -|issued_at|string(date-time)|false|none|IssuedAt is the time (UTC) when the request occurred.| -|messages|[Messages](#schemamessages)|false|none|none| -|methods|object|true|none|Methods contains context for all account verification methods. If a registration request has been
processed, but for example the password is incorrect, this will contain error messages.| -|» **additionalProperties**|[verificationFlowMethod](#schemaverificationflowmethod)|false|none|none| -|request_url|string|false|none|RequestURL is the initial URL that was requested from ORY Kratos. It can be used
to forward information contained in the URL's path or query for example.| -|state|[State](#schemastate)|true|none|none| -|type|[Type](#schematype)|false|none|The flow type can either be `api` or `browser`.| +| Name | Type | Required | Restrictions | Description | +| -------------------------- | ------------------------------------------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| active | string | false | none | Active, if set, contains the registration method that is being used. It is initially
not set. | +| expires_at | string(date-time) | false | none | ExpiresAt is the time (UTC) when the request expires. If the user still wishes to verify the address,
a new request has to be initiated. | +| id | [UUID](#schemauuid) | false | none | none | +| issued_at | string(date-time) | false | none | IssuedAt is the time (UTC) when the request occurred. | +| messages | [Messages](#schemamessages) | false | none | none | +| methods | object | true | none | Methods contains context for all account verification methods. If a registration request has been
processed, but for example the password is incorrect, this will contain error messages. | +| » **additionalProperties** | [verificationFlowMethod](#schemaverificationflowmethod) | false | none | none | +| request_url | string | false | none | RequestURL is the initial URL that was requested from ORY Kratos. It can be used
to forward information contained in the URL's path or query for example. | +| state | [State](#schemastate) | true | none | none | +| type | [Type](#schematype) | false | none | The flow type can either be `api` or `browser`. | @@ -10609,15 +10595,14 @@ p JSON.parse(result) }, "method": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|config|[verificationFlowMethodConfig](#schemaverificationflowmethodconfig)|false|none|none| -|method|string|false|none|Method contains the request credentials type.| +| Name | Type | Required | Restrictions | Description | +| ------ | ------------------------------------------------------------------- | -------- | ------------ | --------------------------------------------- | +| config | [verificationFlowMethodConfig](#schemaverificationflowmethodconfig) | false | none | none | +| method | string | false | none | Method contains the request credentials type. | @@ -10656,17 +10641,16 @@ p JSON.parse(result) ], "method": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|action|string|true|none|Action should be used as the form action URL ``.| -|fields|[formFields](#schemaformfields)|true|none|Fields contains multiple fields| -|messages|[Messages](#schemamessages)|false|none|none| -|method|string|true|none|Method is the form method (e.g. POST)| +| Name | Type | Required | Restrictions | Description | +| -------- | ------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +| action | string | true | none | Action should be used as the form action URL ``. | +| fields | [formFields](#schemaformfields) | true | none | Fields contains multiple fields | +| messages | [Messages](#schemamessages) | false | none | none | +| method | string | true | none | Method is the form method (e.g. POST) | @@ -10678,12 +10662,10 @@ p JSON.parse(result) { "version": "string" } - ``` #### Properties -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|version|string|false|none|Version is the service's version.| - +| Name | Type | Required | Restrictions | Description | +| ------- | ------ | -------- | ------------ | --------------------------------- | +| version | string | false | none | Version is the service's version. | diff --git a/docs/docs/reference/configuration.md b/docs/docs/reference/configuration.md index afcc9aa960c..501cdfcdc4b 100644 --- a/docs/docs/reference/configuration.md +++ b/docs/docs/reference/configuration.md @@ -7,27 +7,29 @@ title: Configuration OPEN AN ISSUE IF YOU WOULD LIKE TO MAKE ADJUSTMENTS HERE AND MAINTAINERS WILL HELP YOU LOCATE THE RIGHT FILE --> -If file `$HOME/.kratos.yaml` exists, it will be used as a configuration file which supports all -configuration settings listed below. +If file `$HOME/.kratos.yaml` exists, it will be used as a configuration file +which supports all configuration settings listed below. -You can load the config file from another source using the `-c path/to/config.yaml` or `--config path/to/config.yaml` -flag: `kratos --config path/to/config.yaml`. +You can load the config file from another source using the +`-c path/to/config.yaml` or `--config path/to/config.yaml` flag: +`kratos --config path/to/config.yaml`. -Config files can be formatted as JSON, YAML and TOML. Some configuration values support reloading without server restart. -All configuration values can be set using environment variables, as documented below. +Config files can be formatted as JSON, YAML and TOML. Some configuration values +support reloading without server restart. All configuration values can be set +using environment variables, as documented below. -To find out more about edge cases like setting string array values through environmental variables head to the -[Configuring ORY services](https://www.ory.sh/docs/ecosystem/configuring) section. +To find out more about edge cases like setting string array values through +environmental variables head to the +[Configuring ORY services](https://www.ory.sh/docs/ecosystem/configuring) +section. ```yaml ## ORY Kratos Configuration # - ## identity ## # identity: - ## JSON Schema URL for default identity traits ## # # Path to the JSON Schema which describes a default identity's traits. @@ -35,7 +37,7 @@ identity: # Examples: # - file://path/to/identity.traits.schema.json # - https://foo.bar.com/path/to/identity.traits.schema.json - # + # # Set this value using environment variables on # - Linux/macOS: # $ export IDENTITY_DEFAULT_SCHEMA_URL= @@ -53,7 +55,7 @@ identity: # url: https://foo.bar.com/path/to/employee.traits.schema.json # - id: employee-v2 # url: https://foo.bar.com/path/to/employee.v2.traits.schema.json - # + # # Set this value using environment variables on # - Linux/macOS: # $ export IDENTITY_SCHEMAS= @@ -79,7 +81,7 @@ identity: # - mysql://user:secret@tcp(mysqld:3306)/database?max_conns=20&max_idle_conns=4 # - cockroach://user@cockroachdb:26257/database?sslmode=disable&max_conns=20&max_idle_conns=4 # - sqlite:///var/lib/sqlite/db.sqlite?_fk=true&mode=rwc -# +# # Set this value using environment variables on # - Linux/macOS: # $ export DSN= @@ -93,7 +95,6 @@ dsn: "postgres://user: ## selfservice ## # selfservice: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -101,7 +102,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_DEFAULT_BROWSER_RETURN_URL= @@ -118,7 +119,7 @@ selfservice: # - - https://app.my-app.com/dashboard # - /dashboard # - https://www.my-app.com/ - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_WHITELISTED_RETURN_URLS= @@ -133,11 +134,9 @@ selfservice: ## flows ## # flows: - ## settings ## # settings: - ## URL of the Settings page. ## # # URL where the Settings UI is hosted. Check the [reference implementation](https://github.com/ory/kratos-selfservice-ui-node). @@ -146,7 +145,7 @@ selfservice: # # Examples: # - https://my-app.com/user/settings - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_SETTINGS_UI_URL= @@ -163,7 +162,7 @@ selfservice: # - 1h # - 1m # - 1s - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_SETTINGS_LIFESPAN= @@ -180,7 +179,7 @@ selfservice: # - 1h # - 1m # - 1s - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_SETTINGS_PRIVILEGED_SESSION_MAX_AGE= @@ -192,7 +191,6 @@ selfservice: ## after ## # after: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -200,7 +198,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_DEFAULT_BROWSER_RETURN_URL= @@ -212,7 +210,6 @@ selfservice: ## password ## # password: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -220,7 +217,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL= @@ -243,7 +240,6 @@ selfservice: ## profile ## # profile: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -251,7 +247,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_SETTINGS_AFTER_PROFILE_DEFAULT_BROWSER_RETURN_URL= @@ -274,11 +270,9 @@ selfservice: ## logout ## # logout: - ## after ## # after: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -286,7 +280,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_LOGOUT_AFTER_DEFAULT_BROWSER_RETURN_URL= @@ -298,7 +292,6 @@ selfservice: ## registration ## # registration: - ## Registration UI URL ## # # URL where the Registration UI is hosted. Check the [reference implementation](https://github.com/ory/kratos-selfservice-ui-node). @@ -307,7 +300,7 @@ selfservice: # # Examples: # - https://my-app.com/signup - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_REGISTRATION_UI_URL= @@ -324,7 +317,7 @@ selfservice: # - 1h # - 1m # - 1s - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_REGISTRATION_LIFESPAN= @@ -336,7 +329,6 @@ selfservice: ## after ## # after: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -344,7 +336,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_DEFAULT_BROWSER_RETURN_URL= @@ -356,7 +348,6 @@ selfservice: ## password ## # password: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -364,7 +355,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL= @@ -387,7 +378,6 @@ selfservice: ## oidc ## # oidc: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -395,7 +385,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_REGISTRATION_AFTER_OIDC_DEFAULT_BROWSER_RETURN_URL= @@ -418,7 +408,6 @@ selfservice: ## login ## # login: - ## Login UI URL ## # # URL where the Login UI is hosted. Check the [reference implementation](https://github.com/ory/kratos-selfservice-ui-node). @@ -427,7 +416,7 @@ selfservice: # # Examples: # - https://my-app.com/login - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_LOGIN_UI_URL= @@ -444,7 +433,7 @@ selfservice: # - 1h # - 1m # - 1s - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_LOGIN_LIFESPAN= @@ -456,7 +445,6 @@ selfservice: ## after ## # after: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -464,7 +452,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_LOGIN_AFTER_DEFAULT_BROWSER_RETURN_URL= @@ -476,7 +464,6 @@ selfservice: ## password ## # password: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -484,7 +471,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_LOGIN_AFTER_PASSWORD_DEFAULT_BROWSER_RETURN_URL= @@ -507,7 +494,6 @@ selfservice: ## oidc ## # oidc: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -515,7 +501,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_LOGIN_AFTER_OIDC_DEFAULT_BROWSER_RETURN_URL= @@ -538,7 +524,6 @@ selfservice: ## Email and Phone Verification and Account Activation Configuration ## # verification: - ## Enable Email/Phone Verification ## # # If set to true will enable [Email and Phone Verification and Account Activation](https://www.ory.sh/kratos/docs/self-service/flows/verify-email-account-activation/). @@ -561,7 +546,7 @@ selfservice: # # Examples: # - https://my-app.com/verify - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_VERIFICATION_UI_URL= @@ -573,7 +558,6 @@ selfservice: ## after ## # after: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -581,7 +565,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_VERIFICATION_AFTER_DEFAULT_BROWSER_RETURN_URL= @@ -600,7 +584,7 @@ selfservice: # - 1h # - 1m # - 1s - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_VERIFICATION_LIFESPAN= @@ -612,7 +596,6 @@ selfservice: ## Account Recovery Configuration ## # recovery: - ## Enable Account Recovery ## # # If set to true will enable [Account Recovery](https://www.ory.sh/kratos/docs/self-service/flows/password-reset-account-recovery/). @@ -635,7 +618,7 @@ selfservice: # # Examples: # - https://my-app.com/verify - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_RECOVERY_UI_URL= @@ -647,7 +630,6 @@ selfservice: ## after ## # after: - ## Redirect browsers to set URL per default ## # # ORY Kratos redirects to this URL per default on completion of self-service flows and other browser interaction. Read this [article for more information on browser redirects](https://www.ory.sh/kratos/docs/concepts/browser-redirect-flow-completion). @@ -655,7 +637,7 @@ selfservice: # Examples: # - https://my-app.com/dashboard # - /dashboard - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_RECOVERY_AFTER_DEFAULT_BROWSER_RETURN_URL= @@ -674,7 +656,7 @@ selfservice: # - 1h # - 1m # - 1s - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_RECOVERY_LIFESPAN= @@ -686,7 +668,6 @@ selfservice: ## error ## # error: - ## ORY Kratos Error UI URL ## # # URL where the ORY Kratos Error UI is hosted. Check the [reference implementation](https://github.com/ory/kratos-selfservice-ui-node). @@ -695,7 +676,7 @@ selfservice: # # Examples: # - https://my-app.com/kratos-error - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SELFSERVICE_FLOWS_ERROR_UI_URL= @@ -707,11 +688,9 @@ selfservice: ## methods ## # methods: - ## profile ## # profile: - ## Enables Profile Management Method ## # # Default value: true @@ -727,7 +706,6 @@ selfservice: ## recovery_token ## # recovery_token: - ## Enables Token-based Account Recovery Method ## # # Default value: true @@ -743,7 +721,6 @@ selfservice: ## password ## # password: - ## Enables Username/Email and Password Method ## # # Default value: true @@ -759,7 +736,6 @@ selfservice: ## oidc ## # oidc: - ## Enables OpenID Connect Method ## # # Default value: false @@ -775,7 +751,6 @@ selfservice: ## config ## # config: - ## OpenID Connect and OAuth2 Providers ## # # A list and configuration of OAuth2 and OpenID Connect providers ORY Kratos should integrate with. @@ -844,20 +819,18 @@ selfservice: # The courier is responsible for sending and delivering messages over email, sms, and other means. # courier: - ## SMTP Configuration ## # # Configures outgoing emails using the SMTP protocol. # smtp: - ## SMTP connection string ## # # This URI will be used to connect to the SMTP server. Use the query parameter to allow (`?skip_ssl_verify=true`) or disallow (`?skip_ssl_verify=false`) self-signed TLS certificates. Please keep in mind that any host other than localhost / 127.0.0.1 must use smtp over TLS (smtps) or the connection will not be possible. # # Examples: # - smtps://foo:bar@my-mailserver:1234/?skip_ssl_verify=false - # + # # Set this value using environment variables on # - Linux/macOS: # $ export COURIER_SMTP_CONNECTION_URI= @@ -886,7 +859,7 @@ courier: # # Examples: # - /conf/courier-templates - # + # # Set this value using environment variables on # - Linux/macOS: # $ export COURIER_TEMPLATE_OVERRIDE_PATH= @@ -898,18 +871,16 @@ courier: ## serve ## # serve: - ## admin ## # admin: - ## Admin Base URL ## # # The URL where the admin endpoint is exposed at. # # Examples: # - https://kratos.private-network:4434/ - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SERVE_ADMIN_BASE_URL= @@ -944,7 +915,7 @@ serve: # # Examples: # - 4434 - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SERVE_ADMIN_PORT= @@ -956,7 +927,6 @@ serve: ## public ## # public: - ## Public Base URL ## # # The URL where the public endpoint is exposed at. @@ -964,7 +934,7 @@ serve: # Examples: # - https://my-app.com/.ory/kratos/public # - /.ory/kratos/public/ - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SERVE_PUBLIC_BASE_URL= @@ -999,7 +969,7 @@ serve: # # Examples: # - 4433 - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SERVE_PUBLIC_PORT= @@ -1011,7 +981,6 @@ serve: ## log ## # log: - ## level ## # # One of: @@ -1022,7 +991,7 @@ log: # - error # - fatal # - panic - # + # # Set this value using environment variables on # - Linux/macOS: # $ export LOG_LEVEL= @@ -1048,7 +1017,7 @@ log: # One of: # - json # - text - # + # # Set this value using environment variables on # - Linux/macOS: # $ export LOG_FORMAT= @@ -1060,7 +1029,6 @@ log: ## secrets ## # secrets: - ## Default Encryption Signing Secrets ## # # The first secret in the array is used for singing and encrypting things while all other keys are used to verify and decrypt older things that were signed with that old secret. @@ -1093,11 +1061,9 @@ secrets: ## Hashing Algorithm Configuration ## # hashers: - ## Configuration for the Argon2id hasher. ## # argon2: - ## memory ## # # Minimum value: 16384 @@ -1161,7 +1127,6 @@ hashers: ## session ## # session: - ## Session Lifespan ## # # Defines how long a session is active. Once that lifespan has been reached, the user needs to sign in again. @@ -1172,7 +1137,7 @@ session: # - 1h # - 1m # - 1s - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SESSION_LIFESPAN= @@ -1184,15 +1149,15 @@ session: ## cookie ## # cookie: - ## Session Cookie Domain ## # # Sets the session cookie domain. Useful when dealing with subdomains. Use with care! # domain: title: Session Cookie Domain - description: Sets the session cookie domain. Useful when dealing with - subdomains. Use with care! + description: + Sets the session cookie domain. Useful when dealing with subdomains. Use + with care! ## Make Session Cookie Persistent ## # @@ -1230,7 +1195,7 @@ session: # - Strict # - Lax # - None - # + # # Set this value using environment variables on # - Linux/macOS: # $ export SESSION_COOKIE_SAME_SITE= @@ -1248,5 +1213,4 @@ session: # > set VERSION= # version: v91333221585.262418.0+qDWwJmAz.2e.tvyE9.buy6nC.THs - -``` \ No newline at end of file +``` diff --git a/docs/docs/self-service/flows/code/login/samples/get.go.txt b/docs/docs/self-service/flows/code/login/samples/get.go.txt index 300c2bf685f..1a95cd96894 100644 --- a/docs/docs/self-service/flows/code/login/samples/get.go.txt +++ b/docs/docs/self-service/flows/code/login/samples/get.go.txt @@ -5,8 +5,6 @@ import ( "github.com/ory/kratos-client-go/client/public" "github.com/ory/kratos-client-go/client" - - "github.com/ory/kratos/internal/httpclient/client/common" ) func main() { @@ -15,8 +13,8 @@ func main() { flowID := "" // Usually something like: res.Request.URL.Query().Get("flow") - rs, err := c.Common.GetSelfServiceLoginFlow( - common.NewGetSelfServiceLoginFlowParams(). + rs, err := c.Public.GetSelfServiceLoginFlow( + public.NewGetSelfServiceLoginFlowParams(). WithID(flowID), ) diff --git a/docs/docs/self-service/flows/code/recovery/samples/get.go.txt b/docs/docs/self-service/flows/code/recovery/samples/get.go.txt index e896ce65c99..4a08ed44642 100644 --- a/docs/docs/self-service/flows/code/recovery/samples/get.go.txt +++ b/docs/docs/self-service/flows/code/recovery/samples/get.go.txt @@ -5,8 +5,6 @@ import ( "github.com/ory/kratos-client-go/client/public" "github.com/ory/kratos-client-go/client" - - "github.com/ory/kratos/internal/httpclient/client/common" ) func main() { @@ -15,7 +13,7 @@ func main() { flowID := "" // Usually something like: res.Request.URL.Query().Get("flow") - rs, err := c.Common.GetSelfServiceRecoveryFlow( + rs, err := c.Public.GetSelfServiceRecoveryFlow( common.NewGetSelfServiceRecoveryFlowParams(). WithID(flowID), ) diff --git a/docs/docs/self-service/flows/code/settings/samples/get.go.txt b/docs/docs/self-service/flows/code/settings/samples/get.go.txt index 69bb977ce73..ef698b4f935 100644 --- a/docs/docs/self-service/flows/code/settings/samples/get.go.txt +++ b/docs/docs/self-service/flows/code/settings/samples/get.go.txt @@ -16,7 +16,7 @@ func main() { flowID := "" // Usually something like: res.Request.URL.Query().Get("flow") - rs, err := c.Common.GetSelfServiceSettingsFlow( + rs, err := c.Public.GetSelfServiceSettingsFlow( common.NewGetSelfServiceSettingsFlowParams(). WithID(flowID), ) diff --git a/docs/docs/self-service/flows/code/verification/samples/get.go.txt b/docs/docs/self-service/flows/code/verification/samples/get.go.txt index fd5eac95341..5094b17a1d2 100644 --- a/docs/docs/self-service/flows/code/verification/samples/get.go.txt +++ b/docs/docs/self-service/flows/code/verification/samples/get.go.txt @@ -6,7 +6,7 @@ import ( "github.com/ory/kratos-client-go/client/public" "github.com/ory/kratos-client-go/client" - "github.com/ory/kratos/internal/httpclient/client/common" + "github.com/ory/kratos/internal/httpclient/client/public" ) func main() { @@ -15,8 +15,8 @@ func main() { flowID := "" // Usually something like: res.Request.URL.Query().Get("flow") - rs, err := c.Common.GetSelfServiceVerificationFlow( - common.NewGetSelfServiceVerificationFlowParams(). + rs, err := c.Public.GetSelfServiceVerificationFlow( + public.NewGetSelfServiceVerificationFlowParams(). WithID(flowID), ) diff --git a/internal/httpclient/client/common/common_client.go b/internal/httpclient/client/common/common_client.go deleted file mode 100644 index c5956c3358e..00000000000 --- a/internal/httpclient/client/common/common_client.go +++ /dev/null @@ -1,323 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package common - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new common API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for common API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientService is the interface for Client methods -type ClientService interface { - GetSchema(params *GetSchemaParams) (*GetSchemaOK, error) - - GetSelfServiceError(params *GetSelfServiceErrorParams) (*GetSelfServiceErrorOK, error) - - GetSelfServiceLoginFlow(params *GetSelfServiceLoginFlowParams) (*GetSelfServiceLoginFlowOK, error) - - GetSelfServiceRecoveryFlow(params *GetSelfServiceRecoveryFlowParams) (*GetSelfServiceRecoveryFlowOK, error) - - GetSelfServiceRegistrationFlow(params *GetSelfServiceRegistrationFlowParams) (*GetSelfServiceRegistrationFlowOK, error) - - GetSelfServiceSettingsFlow(params *GetSelfServiceSettingsFlowParams) (*GetSelfServiceSettingsFlowOK, error) - - GetSelfServiceVerificationFlow(params *GetSelfServiceVerificationFlowParams) (*GetSelfServiceVerificationFlowOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetSchema Get a Traits Schema Definition -*/ -func (a *Client) GetSchema(params *GetSchemaParams) (*GetSchemaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetSchemaParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "getSchema", - Method: "GET", - PathPattern: "/schemas/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetSchemaReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetSchemaOK) - 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 getSchema: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetSelfServiceError gets user facing self service errors - - This endpoint returns the error associated with a user-facing self service errors. - -When accessing this endpoint through ORY Kratos' Public API, ensure that cookies are set as they are required for CSRF to work. To prevent -token scanning attacks, the public endpoint does not return 404 status codes. - -This endpoint supports stub values to help you implement the error UI: - -`?error=stub:500` - returns a stub 500 (Internal Server Error) error. - -More information can be found at [ORY Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors). -*/ -func (a *Client) GetSelfServiceError(params *GetSelfServiceErrorParams) (*GetSelfServiceErrorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetSelfServiceErrorParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "getSelfServiceError", - Method: "GET", - PathPattern: "/self-service/errors", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetSelfServiceErrorReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetSelfServiceErrorOK) - 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 getSelfServiceError: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetSelfServiceLoginFlow gets login flow - - This endpoint returns a login flow's context with, for example, error details and other information. - -More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). -*/ -func (a *Client) GetSelfServiceLoginFlow(params *GetSelfServiceLoginFlowParams) (*GetSelfServiceLoginFlowOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetSelfServiceLoginFlowParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "getSelfServiceLoginFlow", - Method: "GET", - PathPattern: "/self-service/login/flows", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetSelfServiceLoginFlowReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetSelfServiceLoginFlowOK) - 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 getSelfServiceLoginFlow: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetSelfServiceRecoveryFlow gets information about a recovery flow - - This endpoint returns a recovery flow's context with, for example, error details and other information. - -More information can be found at [ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). -*/ -func (a *Client) GetSelfServiceRecoveryFlow(params *GetSelfServiceRecoveryFlowParams) (*GetSelfServiceRecoveryFlowOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetSelfServiceRecoveryFlowParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "getSelfServiceRecoveryFlow", - Method: "GET", - PathPattern: "/self-service/recovery/flows", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetSelfServiceRecoveryFlowReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetSelfServiceRecoveryFlowOK) - 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 getSelfServiceRecoveryFlow: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetSelfServiceRegistrationFlow gets registration flow - - This endpoint returns a registration flow's context with, for example, error details and other information. - -More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). -*/ -func (a *Client) GetSelfServiceRegistrationFlow(params *GetSelfServiceRegistrationFlowParams) (*GetSelfServiceRegistrationFlowOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetSelfServiceRegistrationFlowParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "getSelfServiceRegistrationFlow", - Method: "GET", - PathPattern: "/self-service/registration/flows", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetSelfServiceRegistrationFlowReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetSelfServiceRegistrationFlowOK) - 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 getSelfServiceRegistrationFlow: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetSelfServiceSettingsFlow gets settings flow - - When accessing this endpoint through ORY Kratos' Public API you must ensure that either the ORY Kratos Session Cookie -or the ORY Kratos Session Token are set. The public endpoint does not return 404 status codes -but instead 403 or 500 to improve data privacy. - -You can access this endpoint without credentials when using ORY Kratos' Admin API. - -More information can be found at [ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). -*/ -func (a *Client) GetSelfServiceSettingsFlow(params *GetSelfServiceSettingsFlowParams) (*GetSelfServiceSettingsFlowOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetSelfServiceSettingsFlowParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "getSelfServiceSettingsFlow", - Method: "GET", - PathPattern: "/self-service/settings/flows", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetSelfServiceSettingsFlowReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetSelfServiceSettingsFlowOK) - 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 getSelfServiceSettingsFlow: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetSelfServiceVerificationFlow gets verification flow - - This endpoint returns a verification flow's context with, for example, error details and other information. - -More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). -*/ -func (a *Client) GetSelfServiceVerificationFlow(params *GetSelfServiceVerificationFlowParams) (*GetSelfServiceVerificationFlowOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetSelfServiceVerificationFlowParams() - } - - result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "getSelfServiceVerificationFlow", - Method: "GET", - PathPattern: "/self-service/verification/flows", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, - Schemes: []string{"http", "https"}, - Params: params, - Reader: &GetSelfServiceVerificationFlowReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - }) - if err != nil { - return nil, err - } - success, ok := result.(*GetSelfServiceVerificationFlowOK) - 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 getSelfServiceVerificationFlow: 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/ory_kratos_client.go b/internal/httpclient/client/ory_kratos_client.go index e83baae4618..5dccb7eb0df 100644 --- a/internal/httpclient/client/ory_kratos_client.go +++ b/internal/httpclient/client/ory_kratos_client.go @@ -11,7 +11,6 @@ import ( "github.com/go-openapi/strfmt" "github.com/ory/kratos/internal/httpclient/client/admin" - "github.com/ory/kratos/internal/httpclient/client/common" "github.com/ory/kratos/internal/httpclient/client/health" "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/client/version" @@ -60,7 +59,6 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *OryKratos cli := new(OryKratos) cli.Transport = transport cli.Admin = admin.New(transport, formats) - cli.Common = common.New(transport, formats) cli.Health = health.New(transport, formats) cli.Public = public.New(transport, formats) cli.Version = version.New(transport, formats) @@ -110,8 +108,6 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { type OryKratos struct { Admin admin.ClientService - Common common.ClientService - Health health.ClientService Public public.ClientService @@ -125,7 +121,6 @@ type OryKratos struct { func (c *OryKratos) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Admin.SetTransport(transport) - c.Common.SetTransport(transport) c.Health.SetTransport(transport) c.Public.SetTransport(transport) c.Version.SetTransport(transport) diff --git a/internal/httpclient/client/common/get_schema_parameters.go b/internal/httpclient/client/public/get_schema_parameters.go similarity index 99% rename from internal/httpclient/client/common/get_schema_parameters.go rename to internal/httpclient/client/public/get_schema_parameters.go index fdf8a692485..f7469415eb2 100644 --- a/internal/httpclient/client/common/get_schema_parameters.go +++ b/internal/httpclient/client/public/get_schema_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_schema_responses.go b/internal/httpclient/client/public/get_schema_responses.go similarity index 99% rename from internal/httpclient/client/common/get_schema_responses.go rename to internal/httpclient/client/public/get_schema_responses.go index 74d43bbbcb3..9edcf5764b7 100644 --- a/internal/httpclient/client/common/get_schema_responses.go +++ b/internal/httpclient/client/public/get_schema_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_error_parameters.go b/internal/httpclient/client/public/get_self_service_error_parameters.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_error_parameters.go rename to internal/httpclient/client/public/get_self_service_error_parameters.go index 4c451b2002f..f604c555984 100644 --- a/internal/httpclient/client/common/get_self_service_error_parameters.go +++ b/internal/httpclient/client/public/get_self_service_error_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_error_responses.go b/internal/httpclient/client/public/get_self_service_error_responses.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_error_responses.go rename to internal/httpclient/client/public/get_self_service_error_responses.go index 21fccc2df82..b325811f2ed 100644 --- a/internal/httpclient/client/common/get_self_service_error_responses.go +++ b/internal/httpclient/client/public/get_self_service_error_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_login_flow_parameters.go b/internal/httpclient/client/public/get_self_service_login_flow_parameters.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_login_flow_parameters.go rename to internal/httpclient/client/public/get_self_service_login_flow_parameters.go index 46b7ebd0e6d..cf86fe3f45d 100644 --- a/internal/httpclient/client/common/get_self_service_login_flow_parameters.go +++ b/internal/httpclient/client/public/get_self_service_login_flow_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_login_flow_responses.go b/internal/httpclient/client/public/get_self_service_login_flow_responses.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_login_flow_responses.go rename to internal/httpclient/client/public/get_self_service_login_flow_responses.go index 84a6ac98f81..f32b2ee3062 100644 --- a/internal/httpclient/client/common/get_self_service_login_flow_responses.go +++ b/internal/httpclient/client/public/get_self_service_login_flow_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_recovery_flow_parameters.go b/internal/httpclient/client/public/get_self_service_recovery_flow_parameters.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_recovery_flow_parameters.go rename to internal/httpclient/client/public/get_self_service_recovery_flow_parameters.go index 134b6cfa7ac..cccd2ad9b0e 100644 --- a/internal/httpclient/client/common/get_self_service_recovery_flow_parameters.go +++ b/internal/httpclient/client/public/get_self_service_recovery_flow_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_recovery_flow_responses.go b/internal/httpclient/client/public/get_self_service_recovery_flow_responses.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_recovery_flow_responses.go rename to internal/httpclient/client/public/get_self_service_recovery_flow_responses.go index 9de727e2ba8..b6091bbfcd7 100644 --- a/internal/httpclient/client/common/get_self_service_recovery_flow_responses.go +++ b/internal/httpclient/client/public/get_self_service_recovery_flow_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_registration_flow_parameters.go b/internal/httpclient/client/public/get_self_service_registration_flow_parameters.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_registration_flow_parameters.go rename to internal/httpclient/client/public/get_self_service_registration_flow_parameters.go index 039d3fca779..f9383eae232 100644 --- a/internal/httpclient/client/common/get_self_service_registration_flow_parameters.go +++ b/internal/httpclient/client/public/get_self_service_registration_flow_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_registration_flow_responses.go b/internal/httpclient/client/public/get_self_service_registration_flow_responses.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_registration_flow_responses.go rename to internal/httpclient/client/public/get_self_service_registration_flow_responses.go index 8ad5a2cd0ad..16b1738842e 100644 --- a/internal/httpclient/client/common/get_self_service_registration_flow_responses.go +++ b/internal/httpclient/client/public/get_self_service_registration_flow_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_settings_flow_parameters.go b/internal/httpclient/client/public/get_self_service_settings_flow_parameters.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_settings_flow_parameters.go rename to internal/httpclient/client/public/get_self_service_settings_flow_parameters.go index 2d469ccb7ee..425021bc807 100644 --- a/internal/httpclient/client/common/get_self_service_settings_flow_parameters.go +++ b/internal/httpclient/client/public/get_self_service_settings_flow_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_settings_flow_responses.go b/internal/httpclient/client/public/get_self_service_settings_flow_responses.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_settings_flow_responses.go rename to internal/httpclient/client/public/get_self_service_settings_flow_responses.go index 962380cd87a..489f01901c6 100644 --- a/internal/httpclient/client/common/get_self_service_settings_flow_responses.go +++ b/internal/httpclient/client/public/get_self_service_settings_flow_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_verification_flow_parameters.go b/internal/httpclient/client/public/get_self_service_verification_flow_parameters.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_verification_flow_parameters.go rename to internal/httpclient/client/public/get_self_service_verification_flow_parameters.go index 3c8e4901cfc..7f92cdbdb60 100644 --- a/internal/httpclient/client/common/get_self_service_verification_flow_parameters.go +++ b/internal/httpclient/client/public/get_self_service_verification_flow_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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/common/get_self_service_verification_flow_responses.go b/internal/httpclient/client/public/get_self_service_verification_flow_responses.go similarity index 99% rename from internal/httpclient/client/common/get_self_service_verification_flow_responses.go rename to internal/httpclient/client/public/get_self_service_verification_flow_responses.go index 788dc920477..d9b43954636 100644 --- a/internal/httpclient/client/common/get_self_service_verification_flow_responses.go +++ b/internal/httpclient/client/public/get_self_service_verification_flow_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package common +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 bec1647d8c2..e59eb6ed029 100644 --- a/internal/httpclient/client/public/public_client.go +++ b/internal/httpclient/client/public/public_client.go @@ -41,6 +41,20 @@ type ClientService interface { CompleteSelfServiceVerificationFlowWithLinkMethod(params *CompleteSelfServiceVerificationFlowWithLinkMethodParams) error + GetSchema(params *GetSchemaParams) (*GetSchemaOK, error) + + GetSelfServiceError(params *GetSelfServiceErrorParams) (*GetSelfServiceErrorOK, error) + + GetSelfServiceLoginFlow(params *GetSelfServiceLoginFlowParams) (*GetSelfServiceLoginFlowOK, error) + + GetSelfServiceRecoveryFlow(params *GetSelfServiceRecoveryFlowParams) (*GetSelfServiceRecoveryFlowOK, error) + + GetSelfServiceRegistrationFlow(params *GetSelfServiceRegistrationFlowParams) (*GetSelfServiceRegistrationFlowOK, error) + + GetSelfServiceSettingsFlow(params *GetSelfServiceSettingsFlowParams) (*GetSelfServiceSettingsFlowOK, error) + + GetSelfServiceVerificationFlow(params *GetSelfServiceVerificationFlowParams) (*GetSelfServiceVerificationFlowOK, error) + InitializeSelfServiceBrowserLogoutFlow(params *InitializeSelfServiceBrowserLogoutFlowParams) error InitializeSelfServiceLoginViaAPIFlow(params *InitializeSelfServiceLoginViaAPIFlowParams) (*InitializeSelfServiceLoginViaAPIFlowOK, error) @@ -393,6 +407,276 @@ func (a *Client) CompleteSelfServiceVerificationFlowWithLinkMethod(params *Compl return nil } +/* + GetSchema Get a Traits Schema Definition +*/ +func (a *Client) GetSchema(params *GetSchemaParams) (*GetSchemaOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSchemaParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSchema", + Method: "GET", + PathPattern: "/schemas/{id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetSchemaReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSchemaOK) + 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 getSchema: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSelfServiceError gets user facing self service errors + + This endpoint returns the error associated with a user-facing self service errors. + +This endpoint supports stub values to help you implement the error UI: + +`?error=stub:500` - returns a stub 500 (Internal Server Error) error. + +More information can be found at [ORY Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors). +*/ +func (a *Client) GetSelfServiceError(params *GetSelfServiceErrorParams) (*GetSelfServiceErrorOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSelfServiceErrorParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSelfServiceError", + Method: "GET", + PathPattern: "/self-service/errors", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetSelfServiceErrorReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSelfServiceErrorOK) + 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 getSelfServiceError: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSelfServiceLoginFlow gets login flow + + This endpoint returns a login flow's context with, for example, error details and other information. + +More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). +*/ +func (a *Client) GetSelfServiceLoginFlow(params *GetSelfServiceLoginFlowParams) (*GetSelfServiceLoginFlowOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSelfServiceLoginFlowParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSelfServiceLoginFlow", + Method: "GET", + PathPattern: "/self-service/login/flows", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetSelfServiceLoginFlowReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSelfServiceLoginFlowOK) + 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 getSelfServiceLoginFlow: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSelfServiceRecoveryFlow gets information about a recovery flow + + This endpoint returns a recovery flow's context with, for example, error details and other information. + +More information can be found at [ORY Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx). +*/ +func (a *Client) GetSelfServiceRecoveryFlow(params *GetSelfServiceRecoveryFlowParams) (*GetSelfServiceRecoveryFlowOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSelfServiceRecoveryFlowParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSelfServiceRecoveryFlow", + Method: "GET", + PathPattern: "/self-service/recovery/flows", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetSelfServiceRecoveryFlowReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSelfServiceRecoveryFlowOK) + 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 getSelfServiceRecoveryFlow: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSelfServiceRegistrationFlow gets registration flow + + This endpoint returns a registration flow's context with, for example, error details and other information. + +More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration). +*/ +func (a *Client) GetSelfServiceRegistrationFlow(params *GetSelfServiceRegistrationFlowParams) (*GetSelfServiceRegistrationFlowOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSelfServiceRegistrationFlowParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSelfServiceRegistrationFlow", + Method: "GET", + PathPattern: "/self-service/registration/flows", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetSelfServiceRegistrationFlowReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSelfServiceRegistrationFlowOK) + 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 getSelfServiceRegistrationFlow: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSelfServiceSettingsFlow gets settings flow + + When accessing this endpoint through ORY Kratos' Public API you must ensure that either the ORY Kratos Session Cookie +or the ORY Kratos Session Token are set. The public endpoint does not return 404 status codes +but instead 403 or 500 to improve data privacy. + +You can access this endpoint without credentials when using ORY Kratos' Admin API. + +More information can be found at [ORY Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings). +*/ +func (a *Client) GetSelfServiceSettingsFlow(params *GetSelfServiceSettingsFlowParams) (*GetSelfServiceSettingsFlowOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSelfServiceSettingsFlowParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSelfServiceSettingsFlow", + Method: "GET", + PathPattern: "/self-service/settings/flows", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetSelfServiceSettingsFlowReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSelfServiceSettingsFlowOK) + 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 getSelfServiceSettingsFlow: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSelfServiceVerificationFlow gets verification flow + + This endpoint returns a verification flow's context with, for example, error details and other information. + +More information can be found at [ORY Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation). +*/ +func (a *Client) GetSelfServiceVerificationFlow(params *GetSelfServiceVerificationFlowParams) (*GetSelfServiceVerificationFlowOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSelfServiceVerificationFlowParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSelfServiceVerificationFlow", + Method: "GET", + PathPattern: "/self-service/verification/flows", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json", "application/x-www-form-urlencoded"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetSelfServiceVerificationFlowReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSelfServiceVerificationFlowOK) + 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 getSelfServiceVerificationFlow: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* InitializeSelfServiceBrowserLogoutFlow initializes browser based logout user flow diff --git a/internal/testhelpers/selfservice_login.go b/internal/testhelpers/selfservice_login.go index d43045ce650..5114ce0f3b8 100644 --- a/internal/testhelpers/selfservice_login.go +++ b/internal/testhelpers/selfservice_login.go @@ -18,7 +18,6 @@ import ( "github.com/ory/kratos/driver" "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" - "github.com/ory/kratos/internal/httpclient/client/common" "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/selfservice/flow/login" @@ -45,7 +44,7 @@ func NewLoginUIWith401Response(t *testing.T) *httptest.Server { return ts } -func InitializeLoginFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server, forced bool) *common.GetSelfServiceLoginFlowOK { +func InitializeLoginFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server, forced bool) *public.GetSelfServiceLoginFlowOK { publicClient := NewSDKClient(ts) q := "" @@ -57,8 +56,8 @@ func InitializeLoginFlowViaBrowser(t *testing.T, client *http.Client, ts *httpte require.NoError(t, err) require.NoError(t, res.Body.Close()) - rs, err := publicClient.Common.GetSelfServiceLoginFlow( - common.NewGetSelfServiceLoginFlowParams().WithHTTPClient(client). + rs, err := publicClient.Public.GetSelfServiceLoginFlow( + public.NewGetSelfServiceLoginFlowParams().WithHTTPClient(client). WithID(res.Request.URL.Query().Get("flow")), ) require.NoError(t, err) diff --git a/internal/testhelpers/selfservice_recovery.go b/internal/testhelpers/selfservice_recovery.go index 5b7076b1c6e..debc2468e68 100644 --- a/internal/testhelpers/selfservice_recovery.go +++ b/internal/testhelpers/selfservice_recovery.go @@ -20,7 +20,6 @@ import ( "github.com/ory/kratos/driver" "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" - "github.com/ory/kratos/internal/httpclient/client/common" "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/selfservice/flow/verification" @@ -38,15 +37,15 @@ func NewVerificationUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptes return ts } -func GetVerificationFlow(t *testing.T, client *http.Client, ts *httptest.Server) *common.GetSelfServiceVerificationFlowOK { +func GetVerificationFlow(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceVerificationFlowOK { publicClient := NewSDKClient(ts) res, err := client.Get(ts.URL + verification.RouteInitBrowserFlow) require.NoError(t, err) require.NoError(t, res.Body.Close()) - rs, err := publicClient.Common.GetSelfServiceVerificationFlow( - common.NewGetSelfServiceVerificationFlowParams().WithHTTPClient(client). + rs, err := publicClient.Public.GetSelfServiceVerificationFlow( + public.NewGetSelfServiceVerificationFlowParams().WithHTTPClient(client). WithID(res.Request.URL.Query().Get("flow")), ) require.NoError(t, err, "%s", res.Request.URL.String()) @@ -60,7 +59,7 @@ func VerificationSubmitForm( f *models.VerificationFlowMethodConfig, hc *http.Client, values url.Values, -) (string, *common.GetSelfServiceVerificationFlowOK) { +) (string, *public.GetSelfServiceVerificationFlowOK) { require.NotEmpty(t, f.Action) res, err := hc.PostForm(pointerx.StringR(f.Action), values) @@ -73,8 +72,8 @@ func VerificationSubmitForm( assert.Equal(t, viper.GetString(configuration.ViperKeySelfServiceVerificationUI), res.Request.URL.Scheme+"://"+res.Request.URL.Host+res.Request.URL.Path, "should end up at the settings URL, used: %s", pointerx.StringR(f.Action)) - rs, err := NewSDKClientFromURL(viper.GetString(configuration.ViperKeyPublicBaseURL)).Common.GetSelfServiceVerificationFlow( - common.NewGetSelfServiceVerificationFlowParams().WithHTTPClient(hc). + rs, err := NewSDKClientFromURL(viper.GetString(configuration.ViperKeyPublicBaseURL)).Public.GetSelfServiceVerificationFlow( + public.NewGetSelfServiceVerificationFlowParams().WithHTTPClient(hc). WithID(res.Request.URL.Query().Get("flow")), ) require.NoError(t, err) @@ -83,14 +82,14 @@ func VerificationSubmitForm( return string(body), rs } -func InitializeVerificationFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *common.GetSelfServiceVerificationFlowOK { +func InitializeVerificationFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceVerificationFlowOK { publicClient := NewSDKClient(ts) res, err := client.Get(ts.URL + verification.RouteInitBrowserFlow) require.NoError(t, err) require.NoError(t, res.Body.Close()) - rs, err := publicClient.Common.GetSelfServiceVerificationFlow( - common.NewGetSelfServiceVerificationFlowParams().WithHTTPClient(client). + rs, err := publicClient.Public.GetSelfServiceVerificationFlow( + public.NewGetSelfServiceVerificationFlowParams().WithHTTPClient(client). WithID(res.Request.URL.Query().Get("flow")), ) require.NoError(t, err) diff --git a/internal/testhelpers/selfservice_registration.go b/internal/testhelpers/selfservice_registration.go index 034ad2716b3..95fe2294cc9 100644 --- a/internal/testhelpers/selfservice_registration.go +++ b/internal/testhelpers/selfservice_registration.go @@ -17,7 +17,6 @@ import ( "github.com/ory/kratos/driver" "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" - "github.com/ory/kratos/internal/httpclient/client/common" "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/selfservice/flow/registration" @@ -35,13 +34,13 @@ func NewRegistrationUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptes return ts } -func InitializeRegistrationFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *common.GetSelfServiceRegistrationFlowOK { +func InitializeRegistrationFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceRegistrationFlowOK { res, err := client.Get(ts.URL + registration.RouteInitBrowserFlow) require.NoError(t, err) require.NoError(t, res.Body.Close()) - rs, err := NewSDKClient(ts).Common.GetSelfServiceRegistrationFlow( - common.NewGetSelfServiceRegistrationFlowParams().WithHTTPClient(client). + rs, err := NewSDKClient(ts).Public.GetSelfServiceRegistrationFlow( + public.NewGetSelfServiceRegistrationFlowParams().WithHTTPClient(client). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err) assert.Empty(t, rs.Payload.Active) diff --git a/internal/testhelpers/selfservice_settings.go b/internal/testhelpers/selfservice_settings.go index 913c79fb639..2df16c80578 100644 --- a/internal/testhelpers/selfservice_settings.go +++ b/internal/testhelpers/selfservice_settings.go @@ -26,7 +26,6 @@ import ( "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" "github.com/ory/kratos/internal/httpclient/client" - "github.com/ory/kratos/internal/httpclient/client/common" "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/selfservice/flow/settings" @@ -44,15 +43,15 @@ func NewSettingsUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptest.Se return ts } -func InitializeSettingsFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *common.GetSelfServiceSettingsFlowOK { +func InitializeSettingsFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceSettingsFlowOK { publicClient := NewSDKClient(ts) res, err := client.Get(ts.URL + settings.RouteInitBrowserFlow) require.NoError(t, err) require.NoError(t, res.Body.Close()) - rs, err := publicClient.Common.GetSelfServiceSettingsFlow( - common.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(client). + rs, err := publicClient.Public.GetSelfServiceSettingsFlow( + public.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(client). WithID(res.Request.URL.Query().Get("flow")), ) require.NoError(t, err) @@ -161,7 +160,7 @@ func NewSettingsLoginAcceptAPIServer(t *testing.T, adminClient *client.OryKratos viper.Set(configuration.ViperKeySelfServiceSettingsPrivilegedAuthenticationAfter, "5m") - res, err := adminClient.Common.GetSelfServiceLoginFlow(common.NewGetSelfServiceLoginFlowParams().WithID(r.URL.Query().Get("flow"))) + res, err := adminClient.Public.GetSelfServiceLoginFlow(public.NewGetSelfServiceLoginFlowParams().WithID(r.URL.Query().Get("flow"))) require.NoError(t, err) require.NotEmpty(t, res.Payload.RequestURL) diff --git a/internal/testhelpers/selfservice_verification.go b/internal/testhelpers/selfservice_verification.go index 8ca614f698a..e009d44e1ac 100644 --- a/internal/testhelpers/selfservice_verification.go +++ b/internal/testhelpers/selfservice_verification.go @@ -20,7 +20,6 @@ import ( "github.com/ory/kratos/driver" "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" - "github.com/ory/kratos/internal/httpclient/client/common" "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/selfservice/flow/recovery" @@ -38,15 +37,15 @@ func NewRecoveryUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptest.Se return ts } -func GetRecoveryFlow(t *testing.T, client *http.Client, ts *httptest.Server) *common.GetSelfServiceRecoveryFlowOK { +func GetRecoveryFlow(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceRecoveryFlowOK { publicClient := NewSDKClient(ts) res, err := client.Get(ts.URL + recovery.RouteInitBrowserFlow) require.NoError(t, err) require.NoError(t, res.Body.Close()) - rs, err := publicClient.Common.GetSelfServiceRecoveryFlow( - common.NewGetSelfServiceRecoveryFlowParams().WithHTTPClient(client). + rs, err := publicClient.Public.GetSelfServiceRecoveryFlow( + public.NewGetSelfServiceRecoveryFlowParams().WithHTTPClient(client). WithID(res.Request.URL.Query().Get("flow")), ) require.NoError(t, err, "%s", res.Request.URL.String()) @@ -60,7 +59,7 @@ func RecoverySubmitForm( f *models.RecoveryFlowMethodConfig, hc *http.Client, values url.Values, -) (string, *common.GetSelfServiceRecoveryFlowOK) { +) (string, *public.GetSelfServiceRecoveryFlowOK) { require.NotEmpty(t, f.Action) res, err := hc.PostForm(pointerx.StringR(f.Action), values) @@ -73,8 +72,8 @@ func RecoverySubmitForm( assert.Equal(t, viper.GetString(configuration.ViperKeySelfServiceRecoveryUI), res.Request.URL.Scheme+"://"+res.Request.URL.Host+res.Request.URL.Path, "should end up at the settings URL, used: %s", pointerx.StringR(f.Action)) - rs, err := NewSDKClientFromURL(viper.GetString(configuration.ViperKeyPublicBaseURL)).Common.GetSelfServiceRecoveryFlow( - common.NewGetSelfServiceRecoveryFlowParams().WithHTTPClient(hc). + rs, err := NewSDKClientFromURL(viper.GetString(configuration.ViperKeyPublicBaseURL)).Public.GetSelfServiceRecoveryFlow( + public.NewGetSelfServiceRecoveryFlowParams().WithHTTPClient(hc). WithID(res.Request.URL.Query().Get("flow")), ) require.NoError(t, err) @@ -83,14 +82,14 @@ func RecoverySubmitForm( return string(body), rs } -func InitializeRecoveryFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *common.GetSelfServiceRecoveryFlowOK { +func InitializeRecoveryFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceRecoveryFlowOK { publicClient := NewSDKClient(ts) res, err := client.Get(ts.URL + recovery.RouteInitBrowserFlow) require.NoError(t, err) require.NoError(t, res.Body.Close()) - rs, err := publicClient.Common.GetSelfServiceRecoveryFlow( - common.NewGetSelfServiceRecoveryFlowParams().WithHTTPClient(client). + rs, err := publicClient.Public.GetSelfServiceRecoveryFlow( + public.NewGetSelfServiceRecoveryFlowParams().WithHTTPClient(client). WithID(res.Request.URL.Query().Get("flow")), ) require.NoError(t, err) diff --git a/schema/handler.go b/schema/handler.go index 16eafd7ff41..96df7b3f42c 100644 --- a/schema/handler.go +++ b/schema/handler.go @@ -63,7 +63,7 @@ type getSchemaParameters struct { ID string `json:"id"` } -// swagger:route GET /schemas/{id} common public admin getSchema +// swagger:route GET /schemas/{id} public admin getSchema // // Get a Traits Schema Definition // diff --git a/selfservice/flow/login/error_test.go b/selfservice/flow/login/error_test.go index f7898c13eb1..ac5929bdd6c 100644 --- a/selfservice/flow/login/error_test.go +++ b/selfservice/flow/login/error_test.go @@ -20,7 +20,7 @@ import ( "github.com/ory/kratos/identity" "github.com/ory/kratos/internal" - "github.com/ory/kratos/internal/httpclient/client/common" + sdkp "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/internal/testhelpers" "github.com/ory/kratos/schema" @@ -74,7 +74,7 @@ func TestHandleError(t *testing.T) { defer res.Body.Close() require.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowErrorURL().String()+"?error=") - sse, err := sdk.Common.GetSelfServiceError(common.NewGetSelfServiceErrorParams(). + sse, err := sdk.Public.GetSelfServiceError(sdkp.NewGetSelfServiceErrorParams(). WithError(res.Request.URL.Query().Get("error"))) require.NoError(t, err) @@ -190,7 +190,7 @@ func TestHandleError(t *testing.T) { defer res.Body.Close() assert.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowLoginUI().String()+"?flow=") - lf, err := sdk.Common.GetSelfServiceLoginFlow(common.NewGetSelfServiceLoginFlowParams(). + lf, err := sdk.Public.GetSelfServiceLoginFlow(sdkp.NewGetSelfServiceLoginFlowParams(). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err) return lf.Payload, res diff --git a/selfservice/flow/login/handler.go b/selfservice/flow/login/handler.go index 2741fa1f530..d8c9fb175aa 100644 --- a/selfservice/flow/login/handler.go +++ b/selfservice/flow/login/handler.go @@ -214,7 +214,7 @@ type getSelfServiceLoginFlow struct { ID string `json:"id"` } -// swagger:route GET /self-service/login/flows common public admin getSelfServiceLoginFlow +// swagger:route GET /self-service/login/flows public admin getSelfServiceLoginFlow // // Get Login Flow // diff --git a/selfservice/flow/recovery/error_test.go b/selfservice/flow/recovery/error_test.go index c2d6e30362f..8eb7915172d 100644 --- a/selfservice/flow/recovery/error_test.go +++ b/selfservice/flow/recovery/error_test.go @@ -22,7 +22,7 @@ import ( "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/internal" - "github.com/ory/kratos/internal/httpclient/client/common" + sdkp "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/internal/testhelpers" "github.com/ory/kratos/schema" @@ -77,7 +77,7 @@ func TestHandleError(t *testing.T) { defer res.Body.Close() require.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowErrorURL().String()+"?error=") - sse, err := sdk.Common.GetSelfServiceError(common.NewGetSelfServiceErrorParams(). + sse, err := sdk.Public.GetSelfServiceError(sdkp.NewGetSelfServiceErrorParams(). WithError(res.Request.URL.Query().Get("error"))) require.NoError(t, err) @@ -193,7 +193,7 @@ func TestHandleError(t *testing.T) { defer res.Body.Close() assert.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowRecoveryUI().String()+"?flow=") - lf, err := sdk.Common.GetSelfServiceRecoveryFlow(common.NewGetSelfServiceRecoveryFlowParams(). + lf, err := sdk.Public.GetSelfServiceRecoveryFlow(sdkp.NewGetSelfServiceRecoveryFlowParams(). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err) return lf.Payload, res diff --git a/selfservice/flow/recovery/handler.go b/selfservice/flow/recovery/handler.go index d61c557a942..110e4403c31 100644 --- a/selfservice/flow/recovery/handler.go +++ b/selfservice/flow/recovery/handler.go @@ -153,7 +153,7 @@ type getSelfServiceRecoveryFlowParameters struct { FlowID string `json:"id"` } -// swagger:route GET /self-service/recovery/flows common public admin getSelfServiceRecoveryFlow +// swagger:route GET /self-service/recovery/flows public admin getSelfServiceRecoveryFlow // // Get information about a recovery flow // diff --git a/selfservice/flow/registration/error_test.go b/selfservice/flow/registration/error_test.go index d235ff3141a..c9d22bfd9cf 100644 --- a/selfservice/flow/registration/error_test.go +++ b/selfservice/flow/registration/error_test.go @@ -23,7 +23,7 @@ import ( "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" "github.com/ory/kratos/internal" - "github.com/ory/kratos/internal/httpclient/client/common" + sdkp "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/internal/testhelpers" "github.com/ory/kratos/schema" @@ -79,7 +79,7 @@ func TestHandleError(t *testing.T) { defer res.Body.Close() require.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowErrorURL().String()+"?error=") - sse, err := sdk.Common.GetSelfServiceError(common.NewGetSelfServiceErrorParams(). + sse, err := sdk.Public.GetSelfServiceError(sdkp.NewGetSelfServiceErrorParams(). WithError(res.Request.URL.Query().Get("error"))) require.NoError(t, err) @@ -195,7 +195,7 @@ func TestHandleError(t *testing.T) { defer res.Body.Close() assert.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowRegistrationUI().String()+"?flow=") - lf, err := sdk.Common.GetSelfServiceRegistrationFlow(common.NewGetSelfServiceRegistrationFlowParams(). + lf, err := sdk.Public.GetSelfServiceRegistrationFlow(sdkp.NewGetSelfServiceRegistrationFlowParams(). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err) return lf.Payload, res diff --git a/selfservice/flow/registration/handler.go b/selfservice/flow/registration/handler.go index 53da2cc513e..2aff900a968 100644 --- a/selfservice/flow/registration/handler.go +++ b/selfservice/flow/registration/handler.go @@ -172,7 +172,7 @@ type getSelfServiceRegistrationFlowParameters struct { ID string `json:"id"` } -// swagger:route GET /self-service/registration/flows common public admin getSelfServiceRegistrationFlow +// swagger:route GET /self-service/registration/flows public admin getSelfServiceRegistrationFlow // // Get Registration Flow // diff --git a/selfservice/flow/settings/error_test.go b/selfservice/flow/settings/error_test.go index 4546e287eeb..1922ed60dc1 100644 --- a/selfservice/flow/settings/error_test.go +++ b/selfservice/flow/settings/error_test.go @@ -24,7 +24,7 @@ import ( "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" "github.com/ory/kratos/internal" - "github.com/ory/kratos/internal/httpclient/client/common" + sdkp "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/internal/testhelpers" "github.com/ory/kratos/schema" @@ -86,7 +86,7 @@ func TestHandleError(t *testing.T) { defer res.Body.Close() require.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowErrorURL().String()+"?error=") - sse, err := sdk.Common.GetSelfServiceError(common.NewGetSelfServiceErrorParams(). + sse, err := sdk.Public.GetSelfServiceError(sdkp.NewGetSelfServiceErrorParams(). WithError(res.Request.URL.Query().Get("error"))) require.NoError(t, err) @@ -207,7 +207,7 @@ func TestHandleError(t *testing.T) { defer res.Body.Close() assert.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowSettingsUI().String()+"?flow=") - lf, err := sdk.Common.GetSelfServiceSettingsFlow(common.NewGetSelfServiceSettingsFlowParams(). + lf, err := sdk.Public.GetSelfServiceSettingsFlow(sdkp.NewGetSelfServiceSettingsFlowParams(). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err) return lf.Payload, res diff --git a/selfservice/flow/settings/handler.go b/selfservice/flow/settings/handler.go index 8a9ec7a1003..6706c23041d 100644 --- a/selfservice/flow/settings/handler.go +++ b/selfservice/flow/settings/handler.go @@ -202,7 +202,7 @@ type getSelfServiceSettingsFlowParameters struct { ID string `json:"id"` } -// swagger:route GET /self-service/settings/flows common public admin getSelfServiceSettingsFlow +// swagger:route GET /self-service/settings/flows public admin getSelfServiceSettingsFlow // // Get Settings Flow // diff --git a/selfservice/flow/settings/handler_test.go b/selfservice/flow/settings/handler_test.go index 522dcd97f58..574a64bac5f 100644 --- a/selfservice/flow/settings/handler_test.go +++ b/selfservice/flow/settings/handler_test.go @@ -19,7 +19,7 @@ import ( "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" "github.com/ory/kratos/internal" - "github.com/ory/kratos/internal/httpclient/client/common" + sdkp "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/testhelpers" "github.com/ory/kratos/selfservice/flow" "github.com/ory/kratos/selfservice/flow/login" @@ -56,51 +56,51 @@ func TestHandler(t *testing.T) { t.Run("daemon=admin", func(t *testing.T) { t.Run("description=fetching a non-existent flow should return a 404 error", func(t *testing.T) { - _, err := adminClient.Common.GetSelfServiceSettingsFlow( - common.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(otherUser).WithID("i-do-not-exist"), + _, err := adminClient.Public.GetSelfServiceSettingsFlow( + sdkp.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(otherUser).WithID("i-do-not-exist"), ) require.Error(t, err) - require.IsType(t, &common.GetSelfServiceSettingsFlowNotFound{}, err) - assert.Equal(t, int64(http.StatusNotFound), err.(*common.GetSelfServiceSettingsFlowNotFound).Payload.Error.Code) + require.IsType(t, &sdkp.GetSelfServiceSettingsFlowNotFound{}, err) + assert.Equal(t, int64(http.StatusNotFound), err.(*sdkp.GetSelfServiceSettingsFlowNotFound).Payload.Error.Code) }) t.Run("description=fetching an expired flow returns 410", func(t *testing.T) { pr := newExpiredFlow() require.NoError(t, reg.SettingsFlowPersister().CreateSettingsFlow(context.Background(), pr)) - _, err := adminClient.Common.GetSelfServiceSettingsFlow( - common.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(primaryUser).WithID(pr.ID.String()), + _, err := adminClient.Public.GetSelfServiceSettingsFlow( + sdkp.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(primaryUser).WithID(pr.ID.String()), ) require.Error(t, err) - require.IsType(t, &common.GetSelfServiceSettingsFlowGone{}, err, "%+v", err) - assert.Equal(t, int64(http.StatusGone), err.(*common.GetSelfServiceSettingsFlowGone).Payload.Error.Code) + require.IsType(t, &sdkp.GetSelfServiceSettingsFlowGone{}, err, "%+v", err) + assert.Equal(t, int64(http.StatusGone), err.(*sdkp.GetSelfServiceSettingsFlowGone).Payload.Error.Code) }) }) t.Run("daemon=public", func(t *testing.T) { t.Run("description=fetching a non-existent flow should return a 403 error", func(t *testing.T) { - _, err := publicClient.Common.GetSelfServiceSettingsFlow( - common.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(otherUser).WithID("i-do-not-exist"), + _, err := publicClient.Public.GetSelfServiceSettingsFlow( + sdkp.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(otherUser).WithID("i-do-not-exist"), ) require.Error(t, err) - require.IsType(t, &common.GetSelfServiceSettingsFlowForbidden{}, err) - assert.Equal(t, int64(http.StatusForbidden), err.(*common.GetSelfServiceSettingsFlowForbidden).Payload.Error.Code) + require.IsType(t, &sdkp.GetSelfServiceSettingsFlowForbidden{}, err) + assert.Equal(t, int64(http.StatusForbidden), err.(*sdkp.GetSelfServiceSettingsFlowForbidden).Payload.Error.Code) }) t.Run("description=fetching an expired flow returns 410", func(t *testing.T) { pr := newExpiredFlow() require.NoError(t, reg.SettingsFlowPersister().CreateSettingsFlow(context.Background(), pr)) - _, err := publicClient.Common.GetSelfServiceSettingsFlow( - common.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(primaryUser).WithID(pr.ID.String()), + _, err := publicClient.Public.GetSelfServiceSettingsFlow( + sdkp.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(primaryUser).WithID(pr.ID.String()), ) require.Error(t, err) - require.IsType(t, &common.GetSelfServiceSettingsFlowGone{}, err) - assert.Equal(t, int64(http.StatusGone), err.(*common.GetSelfServiceSettingsFlowGone).Payload.Error.Code) + require.IsType(t, &sdkp.GetSelfServiceSettingsFlowGone{}, err) + assert.Equal(t, int64(http.StatusGone), err.(*sdkp.GetSelfServiceSettingsFlowGone).Payload.Error.Code) }) t.Run("description=should fail to fetch request if identity changed", func(t *testing.T) { @@ -130,12 +130,12 @@ func TestHandler(t *testing.T) { rid := res.Request.URL.Query().Get("flow") require.NotEmpty(t, rid) - _, err = publicClient.Common.GetSelfServiceSettingsFlow( - common.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(otherUser).WithID(rid), + _, err = publicClient.Public.GetSelfServiceSettingsFlow( + sdkp.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(otherUser).WithID(rid), ) require.Error(t, err) - require.IsType(t, &common.GetSelfServiceSettingsFlowForbidden{}, err) - assert.EqualValues(t, int64(http.StatusForbidden), err.(*common.GetSelfServiceSettingsFlowForbidden).Payload.Error.Code, "should return a 403 error because the identities from the cookies do not match") + require.IsType(t, &sdkp.GetSelfServiceSettingsFlowForbidden{}, err) + assert.EqualValues(t, int64(http.StatusForbidden), err.(*sdkp.GetSelfServiceSettingsFlowForbidden).Payload.Error.Code, "should return a 403 error because the identities from the cookies do not match") }) }) diff --git a/selfservice/flow/verification/handler.go b/selfservice/flow/verification/handler.go index 186b2e5a8a5..8a689cc8c76 100644 --- a/selfservice/flow/verification/handler.go +++ b/selfservice/flow/verification/handler.go @@ -142,7 +142,7 @@ type getSelfServiceVerificationFlowParameters struct { FlowID string `json:"id"` } -// swagger:route GET /self-service/verification/flows common public admin getSelfServiceVerificationFlow +// swagger:route GET /self-service/verification/flows public admin getSelfServiceVerificationFlow // // Get Verification Flow // diff --git a/selfservice/strategy/link/strategy_recovery_test.go b/selfservice/strategy/link/strategy_recovery_test.go index bb11d66dd8e..a00449dc99d 100644 --- a/selfservice/strategy/link/strategy_recovery_test.go +++ b/selfservice/strategy/link/strategy_recovery_test.go @@ -25,7 +25,7 @@ import ( "github.com/ory/kratos/identity" "github.com/ory/kratos/internal" "github.com/ory/kratos/internal/httpclient/client/admin" - "github.com/ory/kratos/internal/httpclient/client/common" + sdkp "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/internal/testhelpers" "github.com/ory/kratos/selfservice/flow/recovery" @@ -116,8 +116,8 @@ func TestAdminStrategy(t *testing.T) { assert.Equal(t, http.StatusOK, res.StatusCode) testhelpers.LogJSON(t, rl.Payload) - sr, err := adminSDK.Common.GetSelfServiceSettingsFlow( - common.NewGetSelfServiceSettingsFlowParams(). + sr, err := adminSDK.Public.GetSelfServiceSettingsFlow( + sdkp.NewGetSelfServiceSettingsFlowParams(). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err, "%s", res.Request.URL.String()) @@ -276,8 +276,8 @@ func TestRecovery(t *testing.T) { assert.Equal(t, http.StatusOK, res.StatusCode) assert.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowRecoveryUI().String()+"?flow=") - sr, err := sdk.Common.GetSelfServiceRecoveryFlow( - common.NewGetSelfServiceRecoveryFlowParams().WithHTTPClient(c). + sr, err := sdk.Public.GetSelfServiceRecoveryFlow( + sdkp.NewGetSelfServiceRecoveryFlowParams().WithHTTPClient(c). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err) @@ -327,8 +327,8 @@ func TestRecovery(t *testing.T) { assert.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowRecoveryUI().String()) assert.NotContains(t, res.Request.URL.String(), gjson.Get(body, "id").String()) - sr, err := sdk.Common.GetSelfServiceRecoveryFlow( - common.NewGetSelfServiceRecoveryFlowParams().WithHTTPClient(c). + sr, err := sdk.Public.GetSelfServiceRecoveryFlow( + sdkp.NewGetSelfServiceRecoveryFlowParams().WithHTTPClient(c). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err) diff --git a/selfservice/strategy/link/strategy_verification_test.go b/selfservice/strategy/link/strategy_verification_test.go index c0fc50d8403..9fbaec1c4f9 100644 --- a/selfservice/strategy/link/strategy_verification_test.go +++ b/selfservice/strategy/link/strategy_verification_test.go @@ -20,7 +20,7 @@ import ( "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" "github.com/ory/kratos/internal" - "github.com/ory/kratos/internal/httpclient/client/common" + sdkp "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/internal/testhelpers" "github.com/ory/kratos/selfservice/flow/verification" @@ -143,8 +143,8 @@ func TestVerification(t *testing.T) { assert.Equal(t, http.StatusOK, res.StatusCode) assert.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowVerificationUI().String()+"?flow=") - sr, err := sdk.Common.GetSelfServiceVerificationFlow( - common.NewGetSelfServiceVerificationFlowParams().WithHTTPClient(c). + sr, err := sdk.Public.GetSelfServiceVerificationFlow( + sdkp.NewGetSelfServiceVerificationFlowParams().WithHTTPClient(c). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err) @@ -194,8 +194,8 @@ func TestVerification(t *testing.T) { assert.Contains(t, res.Request.URL.String(), conf.SelfServiceFlowVerificationUI().String()) assert.NotContains(t, res.Request.URL.String(), gjson.Get(body, "id").String()) - sr, err := sdk.Common.GetSelfServiceVerificationFlow( - common.NewGetSelfServiceVerificationFlowParams().WithHTTPClient(c). + sr, err := sdk.Public.GetSelfServiceVerificationFlow( + sdkp.NewGetSelfServiceVerificationFlowParams().WithHTTPClient(c). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err) diff --git a/selfservice/strategy/oidc/strategy_settings_test.go b/selfservice/strategy/oidc/strategy_settings_test.go index 15cbada843e..c1b240839c2 100644 --- a/selfservice/strategy/oidc/strategy_settings_test.go +++ b/selfservice/strategy/oidc/strategy_settings_test.go @@ -23,7 +23,7 @@ import ( "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" "github.com/ory/kratos/internal" - "github.com/ory/kratos/internal/httpclient/client/common" + sdkp "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/internal/testhelpers" "github.com/ory/kratos/selfservice/flow" @@ -129,7 +129,7 @@ func TestSettingsStrategy(t *testing.T) { // does the same as new profile request but uses the SDK var nprSDK = func(t *testing.T, client *http.Client, redirectTo string, exp time.Duration) *models.SettingsFlow { req := newProfileFlow(t, client, redirectTo, exp) - rs, err := admin.Common.GetSelfServiceSettingsFlow(common. + rs, err := admin.Public.GetSelfServiceSettingsFlow(sdkp. NewGetSelfServiceSettingsFlowParams().WithHTTPClient(client). WithID(req.ID.String())) require.NoError(t, err) @@ -160,7 +160,7 @@ func TestSettingsStrategy(t *testing.T) { t.Run("case=should not be able to fetch another user's data", func(t *testing.T) { req := newProfileFlow(t, agents["password"], "", time.Hour) - _, err := public.Common.GetSelfServiceSettingsFlow(common. + _, err := public.Public.GetSelfServiceSettingsFlow(sdkp. NewGetSelfServiceSettingsFlowParams().WithHTTPClient(agents["oryer"]). WithID(req.ID.String())) require.Error(t, err) @@ -170,7 +170,7 @@ func TestSettingsStrategy(t *testing.T) { t.Run("case=should fetch the settings request and expect data to be set appropriately", func(t *testing.T) { req := newProfileFlow(t, agents["password"], "", time.Hour) - rs, err := admin.Common.GetSelfServiceSettingsFlow(common. + rs, err := admin.Public.GetSelfServiceSettingsFlow(sdkp. NewGetSelfServiceSettingsFlowParams().WithHTTPClient(agents["password"]). WithID(req.ID.String())) require.NoError(t, err) @@ -316,7 +316,7 @@ func TestSettingsStrategy(t *testing.T) { _, res, req := unlink(t, agent, provider) assert.Contains(t, res.Request.URL.String(), uiTS.URL+"/login") - rs, err := admin.Common.GetSelfServiceSettingsFlow(common. + rs, err := admin.Public.GetSelfServiceSettingsFlow(sdkp. NewGetSelfServiceSettingsFlowParams().WithHTTPClient(agents[agent]). WithID(string(req.ID))) require.NoError(t, err) @@ -437,7 +437,7 @@ func TestSettingsStrategy(t *testing.T) { _, res, req := link(t, agent, provider) assert.Contains(t, res.Request.URL.String(), uiTS.URL) - rs, err := admin.Common.GetSelfServiceSettingsFlow(common. + rs, err := admin.Public.GetSelfServiceSettingsFlow(sdkp. NewGetSelfServiceSettingsFlowParams().WithHTTPClient(agents[agent]). WithID(string(req.ID))) require.NoError(t, err) @@ -462,7 +462,7 @@ func TestSettingsStrategy(t *testing.T) { _, res, req := link(t, agent, provider) assert.Contains(t, res.Request.URL.String(), uiTS.URL) - rs, err := admin.Common.GetSelfServiceSettingsFlow(common. + rs, err := admin.Public.GetSelfServiceSettingsFlow(sdkp. NewGetSelfServiceSettingsFlowParams().WithHTTPClient(agents[agent]). WithID(string(req.ID))) require.NoError(t, err) @@ -488,7 +488,7 @@ func TestSettingsStrategy(t *testing.T) { _, res, req := link(t, agent, provider) assert.Contains(t, res.Request.URL.String(), uiTS.URL+"/login") - rs, err := admin.Common.GetSelfServiceSettingsFlow(common. + rs, err := admin.Public.GetSelfServiceSettingsFlow(sdkp. NewGetSelfServiceSettingsFlowParams().WithHTTPClient(agents[agent]). WithID(string(req.ID))) require.NoError(t, err) diff --git a/selfservice/strategy/profile/strategy_test.go b/selfservice/strategy/profile/strategy_test.go index d8e51487b05..cda7c138f16 100644 --- a/selfservice/strategy/profile/strategy_test.go +++ b/selfservice/strategy/profile/strategy_test.go @@ -29,7 +29,6 @@ import ( "github.com/ory/kratos/driver/configuration" "github.com/ory/kratos/identity" "github.com/ory/kratos/internal" - "github.com/ory/kratos/internal/httpclient/client/common" "github.com/ory/kratos/internal/httpclient/client/public" "github.com/ory/kratos/internal/httpclient/models" "github.com/ory/kratos/internal/testhelpers" @@ -158,8 +157,8 @@ func TestStrategyTraits(t *testing.T) { rid := res.Request.URL.Query().Get("flow") require.NotEmpty(t, rid) - pr, err := publicClient.Common.GetSelfServiceSettingsFlow( - common.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(browserUser1). + pr, err := publicClient.Public.GetSelfServiceSettingsFlow( + public.NewGetSelfServiceSettingsFlowParams().WithHTTPClient(browserUser1). WithID(res.Request.URL.Query().Get("flow"))) require.NoError(t, err, "%s", rid)