Skip to content

Commit

Permalink
fix(sdk): add all available discriminators
Browse files Browse the repository at this point in the history
Closes #2287
Closes #2288
  • Loading branch information
aeneasr committed Mar 7, 2022
1 parent 33f3dfe commit 5d70f9c
Show file tree
Hide file tree
Showing 27 changed files with 1,627 additions and 66 deletions.
10 changes: 10 additions & 0 deletions .schema/openapi/patches/selfservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
value:
- "$ref": "#/components/schemas/submitSelfServiceRegistrationFlowWithPasswordMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceRegistrationFlowWithOidcMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceRegistrationFlowWithWebAuthnMethodBody"
- op: add
path: /components/schemas/submitSelfServiceRegistrationFlowBody/discriminator
value:
propertyName: method
mapping:
password: "#/components/schemas/submitSelfServiceRegistrationFlowWithPasswordMethodBody"
oidc: "#/components/schemas/submitSelfServiceRegistrationFlowWithOidcMethodBody"
webauthn: "#/components/schemas/submitSelfServiceRegistrationFlowWithWebAuthnMethodBody"
# end

# All modifications for the login flow
Expand All @@ -34,6 +36,8 @@
- "$ref": "#/components/schemas/submitSelfServiceLoginFlowWithPasswordMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceLoginFlowWithOidcMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceLoginFlowWithTotpMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceLoginFlowWithWebAuthnMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceLoginFlowWithLookupSecretMethodBody"
- op: add
path: /components/schemas/submitSelfServiceLoginFlowBody/discriminator
value:
Expand All @@ -42,6 +46,8 @@
password: "#/components/schemas/submitSelfServiceLoginFlowWithPasswordMethodBody"
oidc: "#/components/schemas/submitSelfServiceLoginFlowWithOidcMethodBody"
totp: "#/components/schemas/submitSelfServiceLoginFlowWithTotpMethodBody"
webauthn: "#/components/schemas/submitSelfServiceLoginFlowWithWebAuthnMethodBody"
lookup_secret: "#/components/schemas/submitSelfServiceLoginFlowWithLookupSecretMethodBody"
# end

# All modifications for the recovery flow
Expand Down Expand Up @@ -97,6 +103,8 @@
- "$ref": "#/components/schemas/submitSelfServiceSettingsFlowWithOidcMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceSettingsFlowWithOidcMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceSettingsFlowWithTotpMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceSettingsFlowWithWebAuthnMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceSettingsFlowWithLookupMethodBody"
- op: add
path: /components/schemas/submitSelfServiceSettingsFlowBody/discriminator
value:
Expand All @@ -106,6 +114,8 @@
profile: "#/components/schemas/submitSelfServiceSettingsFlowWithProfileMethodBody"
oidc: "#/components/schemas/submitSelfServiceSettingsFlowWithOidcMethodBody"
totp: "#/components/schemas/submitSelfServiceSettingsFlowWithTotpMethodBody"
webauthn: "#/components/schemas/submitSelfServiceSettingsFlowWithWebAuthnMethodBody"
lookup_secret: "#/components/schemas/submitSelfServiceSettingsFlowWithLookupMethodBody"
- op: add
path: /components/schemas/selfServiceSettingsFlowState/enum
value:
Expand Down
4 changes: 4 additions & 0 deletions internal/httpclient/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ docs/Session.md
docs/SessionAuthenticationMethod.md
docs/SessionDevice.md
docs/SettingsProfileFormConfig.md
docs/SubmitSelfServiceFlowWithWebAuthnRegistrationMethod.md
docs/SubmitSelfServiceLoginFlowBody.md
docs/SubmitSelfServiceLoginFlowWithLookupSecretMethodBody.md
docs/SubmitSelfServiceLoginFlowWithOidcMethodBody.md
Expand All @@ -67,6 +68,7 @@ docs/SubmitSelfServiceRecoveryFlowWithLinkMethodBody.md
docs/SubmitSelfServiceRegistrationFlowBody.md
docs/SubmitSelfServiceRegistrationFlowWithOidcMethodBody.md
docs/SubmitSelfServiceRegistrationFlowWithPasswordMethodBody.md
docs/SubmitSelfServiceRegistrationFlowWithWebAuthnMethodBody.md
docs/SubmitSelfServiceSettingsFlowBody.md
docs/SubmitSelfServiceSettingsFlowWithLookupMethodBody.md
docs/SubmitSelfServiceSettingsFlowWithOidcMethodBody.md
Expand Down Expand Up @@ -141,6 +143,7 @@ model_session.go
model_session_authentication_method.go
model_session_device.go
model_settings_profile_form_config.go
model_submit_self_service_flow_with_web_authn_registration_method.go
model_submit_self_service_login_flow_body.go
model_submit_self_service_login_flow_with_lookup_secret_method_body.go
model_submit_self_service_login_flow_with_oidc_method_body.go
Expand All @@ -153,6 +156,7 @@ model_submit_self_service_recovery_flow_with_link_method_body.go
model_submit_self_service_registration_flow_body.go
model_submit_self_service_registration_flow_with_oidc_method_body.go
model_submit_self_service_registration_flow_with_password_method_body.go
model_submit_self_service_registration_flow_with_web_authn_method_body.go
model_submit_self_service_settings_flow_body.go
model_submit_self_service_settings_flow_with_lookup_method_body.go
model_submit_self_service_settings_flow_with_oidc_method_body.go
Expand Down
2 changes: 2 additions & 0 deletions internal/httpclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ Class | Method | HTTP request | Description
- [SessionAuthenticationMethod](docs/SessionAuthenticationMethod.md)
- [SessionDevice](docs/SessionDevice.md)
- [SettingsProfileFormConfig](docs/SettingsProfileFormConfig.md)
- [SubmitSelfServiceFlowWithWebAuthnRegistrationMethod](docs/SubmitSelfServiceFlowWithWebAuthnRegistrationMethod.md)
- [SubmitSelfServiceLoginFlowBody](docs/SubmitSelfServiceLoginFlowBody.md)
- [SubmitSelfServiceLoginFlowWithLookupSecretMethodBody](docs/SubmitSelfServiceLoginFlowWithLookupSecretMethodBody.md)
- [SubmitSelfServiceLoginFlowWithOidcMethodBody](docs/SubmitSelfServiceLoginFlowWithOidcMethodBody.md)
Expand All @@ -188,6 +189,7 @@ Class | Method | HTTP request | Description
- [SubmitSelfServiceRegistrationFlowBody](docs/SubmitSelfServiceRegistrationFlowBody.md)
- [SubmitSelfServiceRegistrationFlowWithOidcMethodBody](docs/SubmitSelfServiceRegistrationFlowWithOidcMethodBody.md)
- [SubmitSelfServiceRegistrationFlowWithPasswordMethodBody](docs/SubmitSelfServiceRegistrationFlowWithPasswordMethodBody.md)
- [SubmitSelfServiceRegistrationFlowWithWebAuthnMethodBody](docs/SubmitSelfServiceRegistrationFlowWithWebAuthnMethodBody.md)
- [SubmitSelfServiceSettingsFlowBody](docs/SubmitSelfServiceSettingsFlowBody.md)
- [SubmitSelfServiceSettingsFlowWithLookupMethodBody](docs/SubmitSelfServiceSettingsFlowWithLookupMethodBody.md)
- [SubmitSelfServiceSettingsFlowWithOidcMethodBody](docs/SubmitSelfServiceSettingsFlowWithOidcMethodBody.md)
Expand Down
107 changes: 95 additions & 12 deletions internal/httpclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ paths:
name: page
required: false
schema:
default: 0
default: 1
format: int64
minimum: 0
minimum: 1
type: integer
style: form
responses:
Expand Down Expand Up @@ -424,9 +424,9 @@ paths:
name: page
required: false
schema:
default: 0
default: 1
format: int64
minimum: 0
minimum: 1
type: integer
style: form
- description: Active is a boolean flag that filters out sessions based on the
Expand Down Expand Up @@ -540,9 +540,9 @@ paths:
name: page
required: false
schema:
default: 0
default: 1
format: int64
minimum: 0
minimum: 1
type: integer
style: form
responses:
Expand Down Expand Up @@ -2354,9 +2354,9 @@ paths:
name: page
required: false
schema:
default: 0
default: 1
format: int64
minimum: 0
minimum: 1
type: integer
style: form
responses:
Expand Down Expand Up @@ -2909,6 +2909,7 @@ components:
- identifiers
created_at: 2000-01-23T04:56:07.000+00:00
config: '{}'
version: 0
verifiable_addresses:
- updated_at: 2014-01-01T23:28:56.782Z
verified_at: 2000-01-23T04:56:07.000+00:00
Expand Down Expand Up @@ -3000,6 +3001,7 @@ components:
- identifiers
created_at: 2000-01-23T04:56:07.000+00:00
config: '{}'
version: 0
properties:
config:
title: JSONRawMessage represents a json.RawMessage that works well with
Expand All @@ -3021,6 +3023,11 @@ components:
description: UpdatedAt is a helper struct field for gobuffalo.pop.
format: date-time
type: string
version:
description: Version refers to the version of the credential. Useful when
changing the config schema.
format: int64
type: integer
type: object
identityCredentialsOidc:
properties:
Expand Down Expand Up @@ -3183,10 +3190,10 @@ components:
pagination:
properties:
page:
default: 0
default: 1
description: Pagination Page
format: int64
minimum: 0
minimum: 1
type: integer
per_page:
default: 250
Expand Down Expand Up @@ -3792,6 +3799,7 @@ components:
- identifiers
created_at: 2000-01-23T04:56:07.000+00:00
config: '{}'
version: 0
verifiable_addresses:
- updated_at: 2014-01-01T23:28:56.782Z
verified_at: 2000-01-23T04:56:07.000+00:00
Expand Down Expand Up @@ -4025,6 +4033,7 @@ components:
- identifiers
created_at: 2000-01-23T04:56:07.000+00:00
config: '{}'
version: 0
verifiable_addresses:
- updated_at: 2014-01-01T23:28:56.782Z
verified_at: 2000-01-23T04:56:07.000+00:00
Expand Down Expand Up @@ -4101,6 +4110,8 @@ components:
completed_at: 2000-01-23T04:56:07.000+00:00
method: link_recovery
properties:
aal:
$ref: '#/components/schemas/authenticatorAssuranceLevel'
completed_at:
description: When the authentication challenge was completed.
format: date-time
Expand Down Expand Up @@ -4155,17 +4166,37 @@ components:
- method
- nodes
type: object
submitSelfServiceFlowWithWebAuthnRegistrationMethod:
properties:
webauthn_register:
description: |-
Register a WebAuthn Security Key
It is expected that the JSON returned by the WebAuthn registration process
is included here.
type: string
webauthn_register_displayname:
description: |-
Name of the WebAuthn Security Key to be Added
A human-readable name for the security key which will be added.
type: string
type: object
submitSelfServiceLoginFlowBody:
discriminator:
mapping:
lookup_secret: '#/components/schemas/submitSelfServiceLoginFlowWithLookupSecretMethodBody'
oidc: '#/components/schemas/submitSelfServiceLoginFlowWithOidcMethodBody'
password: '#/components/schemas/submitSelfServiceLoginFlowWithPasswordMethodBody'
totp: '#/components/schemas/submitSelfServiceLoginFlowWithTotpMethodBody'
webauthn: '#/components/schemas/submitSelfServiceLoginFlowWithWebAuthnMethodBody'
propertyName: method
oneOf:
- $ref: '#/components/schemas/submitSelfServiceLoginFlowWithPasswordMethodBody'
- $ref: '#/components/schemas/submitSelfServiceLoginFlowWithOidcMethodBody'
- $ref: '#/components/schemas/submitSelfServiceLoginFlowWithTotpMethodBody'
- $ref: '#/components/schemas/submitSelfServiceLoginFlowWithWebAuthnMethodBody'
- $ref: '#/components/schemas/submitSelfServiceLoginFlowWithLookupSecretMethodBody'
submitSelfServiceLoginFlowWithLookupSecretMethodBody:
properties:
csrf_token:
Expand Down Expand Up @@ -4216,6 +4247,10 @@ components:
description: Sending the anti-csrf token is only required for browser login
flows.
type: string
identifier:
description: Identifier is the email or username of the user trying to log
in.
type: string
method:
description: Method should be set to "password" when logging in using the
identifier and password strategy.
Expand All @@ -4224,10 +4259,12 @@ components:
description: The user's password.
type: string
password_identifier:
description: Identifier is the email or username of the user trying to log
in.
description: |-
Identifier is the email or username of the user trying to log in.
This field is deprecated!
type: string
required:
- identifier
- method
- password
- password_identifier
Expand Down Expand Up @@ -4259,6 +4296,12 @@ components:
description: Sending the anti-csrf token is only required for browser login
flows.
type: string
identifier:
description: |-
Identifier is the email or username of the user trying to log in. This field is
only required when using WebAuthn for passwordless login. When using WebAuthn
for multi-factor authentication, it is not needed.
type: string
method:
description: Method should be set to "webAuthn" when logging in using the
WebAuthn strategy.
Expand Down Expand Up @@ -4321,10 +4364,12 @@ components:
mapping:
oidc: '#/components/schemas/submitSelfServiceRegistrationFlowWithOidcMethodBody'
password: '#/components/schemas/submitSelfServiceRegistrationFlowWithPasswordMethodBody'
webauthn: '#/components/schemas/submitSelfServiceRegistrationFlowWithWebAuthnMethodBody'
propertyName: method
oneOf:
- $ref: '#/components/schemas/submitSelfServiceRegistrationFlowWithPasswordMethodBody'
- $ref: '#/components/schemas/submitSelfServiceRegistrationFlowWithOidcMethodBody'
- $ref: '#/components/schemas/submitSelfServiceRegistrationFlowWithWebAuthnMethodBody'
submitSelfServiceRegistrationFlowWithOidcMethodBody:
description: |-
SubmitSelfServiceRegistrationFlowWithOidcMethodBody is used to decode the registration form payload
Expand Down Expand Up @@ -4374,20 +4419,55 @@ components:
- password
- traits
type: object
submitSelfServiceRegistrationFlowWithWebAuthnMethodBody:
properties:
csrf_token:
description: CSRFToken is the anti-CSRF token
type: string
method:
description: |-
Method
Should be set to "webauthn" when trying to add, update, or remove a webAuthn pairing.
type: string
traits:
description: The identity's traits
type: object
webauthn_register:
description: |-
Register a WebAuthn Security Key
It is expected that the JSON returned by the WebAuthn registration process
is included here.
type: string
webauthn_register_displayname:
description: |-
Name of the WebAuthn Security Key to be Added
A human-readable name for the security key which will be added.
type: string
required:
- method
- traits
type: object
submitSelfServiceSettingsFlowBody:
discriminator:
mapping:
lookup_secret: '#/components/schemas/submitSelfServiceSettingsFlowWithLookupMethodBody'
oidc: '#/components/schemas/submitSelfServiceSettingsFlowWithOidcMethodBody'
password: '#/components/schemas/submitSelfServiceSettingsFlowWithPasswordMethodBody'
profile: '#/components/schemas/submitSelfServiceSettingsFlowWithProfileMethodBody'
totp: '#/components/schemas/submitSelfServiceSettingsFlowWithTotpMethodBody'
webauthn: '#/components/schemas/submitSelfServiceSettingsFlowWithWebAuthnMethodBody'
propertyName: method
oneOf:
- $ref: '#/components/schemas/submitSelfServiceSettingsFlowWithPasswordMethodBody'
- $ref: '#/components/schemas/submitSelfServiceSettingsFlowWithProfileMethodBody'
- $ref: '#/components/schemas/submitSelfServiceSettingsFlowWithOidcMethodBody'
- $ref: '#/components/schemas/submitSelfServiceSettingsFlowWithOidcMethodBody'
- $ref: '#/components/schemas/submitSelfServiceSettingsFlowWithTotpMethodBody'
- $ref: '#/components/schemas/submitSelfServiceSettingsFlowWithWebAuthnMethodBody'
- $ref: '#/components/schemas/submitSelfServiceSettingsFlowWithLookupMethodBody'
submitSelfServiceSettingsFlowWithLookupMethodBody:
properties:
csrf_token:
Expand Down Expand Up @@ -4616,6 +4696,7 @@ components:
- identifiers
created_at: 2000-01-23T04:56:07.000+00:00
config: '{}'
version: 0
verifiable_addresses:
- updated_at: 2014-01-01T23:28:56.782Z
verified_at: 2000-01-23T04:56:07.000+00:00
Expand Down Expand Up @@ -4685,6 +4766,7 @@ components:
- identifiers
created_at: 2000-01-23T04:56:07.000+00:00
config: '{}'
version: 0
verifiable_addresses:
- updated_at: 2014-01-01T23:28:56.782Z
verified_at: 2000-01-23T04:56:07.000+00:00
Expand Down Expand Up @@ -4736,6 +4818,7 @@ components:
- identifiers
created_at: 2000-01-23T04:56:07.000+00:00
config: '{}'
version: 0
verifiable_addresses:
- updated_at: 2014-01-01T23:28:56.782Z
verified_at: 2000-01-23T04:56:07.000+00:00
Expand Down
Loading

0 comments on commit 5d70f9c

Please sign in to comment.