Skip to content

Commit

Permalink
feat: proper enum and type assertions for openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Oct 19, 2021
1 parent 9833962 commit c4d8516
Show file tree
Hide file tree
Showing 32 changed files with 733 additions and 263 deletions.
6 changes: 6 additions & 0 deletions .schema/openapi/patches/identity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
value:
- active
- inactive
- op: add
path: /components/schemas/identityCredentialsType/enum
value:
- password
- totp
- oidc
5 changes: 5 additions & 0 deletions .schema/openapi/patches/selfservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
value:
- "$ref": "#/components/schemas/submitSelfServiceLoginFlowWithPasswordMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceLoginFlowWithOidcMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceLoginFlowWithTotpMethodBody"
- op: add
path: /components/schemas/submitSelfServiceLoginFlowBody/discriminator
value:
propertyName: method
mapping:
password: "#/components/schemas/submitSelfServiceLoginFlowWithPasswordMethodBody"
oidc: "#/components/schemas/submitSelfServiceLoginFlowWithOidcMethodBody"
totp: "#/components/schemas/submitSelfServiceLoginFlowWithTotpMethodBody"
# end

# All modifications for the recovery flow
Expand Down Expand Up @@ -93,6 +95,8 @@
- "$ref": "#/components/schemas/submitSelfServiceSettingsFlowWithPasswordMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceSettingsFlowWithProfileMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceSettingsFlowWithOidcMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceSettingsFlowWithOidcMethodBody"
- "$ref": "#/components/schemas/submitSelfServiceSettingsFlowWithTotpMethodBody"
- op: add
path: /components/schemas/submitSelfServiceSettingsFlowBody/discriminator
value:
Expand All @@ -101,6 +105,7 @@
password: "#/components/schemas/submitSelfServiceSettingsFlowWithPasswordMethodBody"
profile: "#/components/schemas/submitSelfServiceSettingsFlowWithProfileMethodBody"
oidc: "#/components/schemas/submitSelfServiceSettingsFlowWithOidcMethodBody"
totp: "#/components/schemas/submitSelfServiceSettingsFlowWithTotpMethodBody"
- op: add
path: /components/schemas/selfServiceSettingsFlowState/enum
value:
Expand Down
17 changes: 17 additions & 0 deletions .schema/openapi/patches/session.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,20 @@
- op: add
path: /paths/~1sessions~1whoami/get/parameters/1/example
value: ory_kratos_session=a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f==
- op: add
path: /components/schemas/authenticatorAssuranceLevel/enum
value:
- aal0
- aal1
- aal2
- aal3
- op: replace
path: /components/schemas/sessionAuthenticationMethod/properties/method
value:
title: The method used
type: string
enum:
- link_recovery
- password
- totp
- oidc
70 changes: 64 additions & 6 deletions internal/httpclient/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,51 @@ README.md
api/openapi.yaml
api_metadata.go
api_v0alpha1.go
api_v0alpha2.go
client.go
configuration.go
docs/AdminCreateIdentityBody.md
docs/AdminCreateSelfServiceRecoveryLinkBody.md
docs/AdminUpdateIdentityBody.md
docs/AuthenticateOKBody.md
docs/AuthenticatorAssuranceLevel.md
docs/ContainerChangeResponseItem.md
docs/ContainerCreateCreatedBody.md
docs/ContainerTopOKBody.md
docs/ContainerUpdateOKBody.md
docs/ContainerWaitOKBody.md
docs/ContainerWaitOKBodyError.md
docs/ErrorResponse.md
docs/GenericError.md
docs/GraphDriverData.md
docs/HealthNotReadyStatus.md
docs/HealthStatus.md
docs/IdResponse.md
docs/Identity.md
docs/IdentityCredentials.md
docs/IdentitySchema.md
docs/IdentityCredentialsType.md
docs/IdentityState.md
docs/ImageDeleteResponseItem.md
docs/ImageSummary.md
docs/InlineResponse200.md
docs/InlineResponse2001.md
docs/InlineResponse503.md
docs/JsonError.md
docs/Meta.md
docs/MetadataApi.md
docs/Plugin.md
docs/PluginConfig.md
docs/PluginConfigArgs.md
docs/PluginConfigInterface.md
docs/PluginConfigLinux.md
docs/PluginConfigNetwork.md
docs/PluginConfigRootfs.md
docs/PluginConfigUser.md
docs/PluginDevice.md
docs/PluginEnv.md
docs/PluginInterfaceType.md
docs/PluginMount.md
docs/PluginSettings.md
docs/Port.md
docs/RecoveryAddress.md
docs/SelfServiceError.md
docs/SelfServiceLoginFlow.md
Expand All @@ -35,14 +61,15 @@ docs/SelfServiceSettingsFlow.md
docs/SelfServiceSettingsFlowState.md
docs/SelfServiceVerificationFlow.md
docs/SelfServiceVerificationFlowState.md
docs/ServiceUpdateResponse.md
docs/Session.md
docs/SessionAuthenticationMethod.md
docs/SessionDevice.md
docs/SettingsProfileFormConfig.md
docs/SubmitSelfServiceLoginFlowBody.md
docs/SubmitSelfServiceLoginFlowWithOidcMethodBody.md
docs/SubmitSelfServiceLoginFlowWithPasswordMethodBody.md
docs/SubmitSelfServiceLoginFlowWithTOTPMethodBody.md
docs/SubmitSelfServiceLoginFlowWithTotpMethodBody.md
docs/SubmitSelfServiceLogoutFlowWithoutBrowserBody.md
docs/SubmitSelfServiceRecoveryFlowBody.md
docs/SubmitSelfServiceRecoveryFlowWithLinkMethodBody.md
Expand All @@ -53,7 +80,7 @@ docs/SubmitSelfServiceSettingsFlowBody.md
docs/SubmitSelfServiceSettingsFlowWithOidcMethodBody.md
docs/SubmitSelfServiceSettingsFlowWithPasswordMethodBody.md
docs/SubmitSelfServiceSettingsFlowWithProfileMethodBody.md
docs/SubmitSelfServiceSettingsFlowWithTOTPMethodBody.md
docs/SubmitSelfServiceSettingsFlowWithTotpMethodBody.md
docs/SubmitSelfServiceVerificationFlowBody.md
docs/SubmitSelfServiceVerificationFlowWithLinkMethodBody.md
docs/SuccessfulSelfServiceLoginWithoutBrowser.md
Expand All @@ -68,27 +95,55 @@ docs/UiNodeInputAttributes.md
docs/UiNodeTextAttributes.md
docs/UiText.md
docs/V0alpha1Api.md
docs/V0alpha2Api.md
docs/VerifiableIdentityAddress.md
docs/Version.md
docs/Volume.md
docs/VolumeUsageData.md
git_push.sh
go.mod
go.sum
model_admin_create_identity_body.go
model_admin_create_self_service_recovery_link_body.go
model_admin_update_identity_body.go
model_authenticate_ok_body.go
model_authenticator_assurance_level.go
model_container_change_response_item.go
model_container_create_created_body.go
model_container_top_ok_body.go
model_container_update_ok_body.go
model_container_wait_ok_body.go
model_container_wait_ok_body_error.go
model_error_response.go
model_generic_error.go
model_graph_driver_data.go
model_health_not_ready_status.go
model_health_status.go
model_id_response.go
model_identity.go
model_identity_credentials.go
model_identity_schema.go
model_identity_credentials_type.go
model_identity_state.go
model_image_delete_response_item.go
model_image_summary.go
model_inline_response_200.go
model_inline_response_200_1.go
model_inline_response_503.go
model_json_error.go
model_meta.go
model_plugin.go
model_plugin_config.go
model_plugin_config_args.go
model_plugin_config_interface.go
model_plugin_config_linux_.go
model_plugin_config_network.go
model_plugin_config_rootfs.go
model_plugin_config_user.go
model_plugin_device.go
model_plugin_env.go
model_plugin_interface_type.go
model_plugin_mount.go
model_plugin_settings.go
model_port.go
model_recovery_address.go
model_self_service_error.go
model_self_service_login_flow.go
Expand All @@ -101,6 +156,7 @@ model_self_service_settings_flow.go
model_self_service_settings_flow_state.go
model_self_service_verification_flow.go
model_self_service_verification_flow_state.go
model_service_update_response.go
model_session.go
model_session_authentication_method.go
model_session_device.go
Expand Down Expand Up @@ -135,5 +191,7 @@ model_ui_node_text_attributes.go
model_ui_text.go
model_verifiable_identity_address.go
model_version.go
model_volume.go
model_volume_usage_data.go
response.go
utils.go
38 changes: 33 additions & 5 deletions internal/httpclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ Class | Method | HTTP request | Description
*V0alpha1Api* | [**AdminCreateIdentity**](docs/V0alpha1Api.md#admincreateidentity) | **Post** /identities | Create an Identity
*V0alpha1Api* | [**AdminCreateSelfServiceRecoveryLink**](docs/V0alpha1Api.md#admincreateselfservicerecoverylink) | **Post** /recovery/link | Create a Recovery Link
*V0alpha1Api* | [**AdminDeleteIdentity**](docs/V0alpha1Api.md#admindeleteidentity) | **Delete** /identities/{id} | Delete an Identity
*V0alpha1Api* | [**AdminDeleteIdentitySessions**](docs/V0alpha1Api.md#admindeleteidentitysessions) | **Delete** /identities/{id}/sessions | Calling this endpoint irrecoverably and permanently deletes and invalidates all sessions that belong to the given Identity.
*V0alpha1Api* | [**AdminGetIdentity**](docs/V0alpha1Api.md#admingetidentity) | **Get** /identities/{id} | Get an Identity
*V0alpha1Api* | [**AdminListIdentities**](docs/V0alpha1Api.md#adminlistidentities) | **Get** /identities | List Identities
*V0alpha1Api* | [**AdminUpdateIdentity**](docs/V0alpha1Api.md#adminupdateidentity) | **Put** /identities/{id} | Update an Identity
Expand Down Expand Up @@ -120,26 +119,52 @@ Class | Method | HTTP request | Description
*V0alpha1Api* | [**SubmitSelfServiceSettingsFlow**](docs/V0alpha1Api.md#submitselfservicesettingsflow) | **Post** /self-service/settings | Complete Settings Flow
*V0alpha1Api* | [**SubmitSelfServiceVerificationFlow**](docs/V0alpha1Api.md#submitselfserviceverificationflow) | **Post** /self-service/verification | Complete Verification Flow
*V0alpha1Api* | [**ToSession**](docs/V0alpha1Api.md#tosession) | **Get** /sessions/whoami | Check Who the Current HTTP Session Belongs To
*V0alpha2Api* | [**ListIdentitySchemas**](docs/V0alpha2Api.md#listidentityschemas) | **Get** /schemas |


## Documentation For Models

- [AdminCreateIdentityBody](docs/AdminCreateIdentityBody.md)
- [AdminCreateSelfServiceRecoveryLinkBody](docs/AdminCreateSelfServiceRecoveryLinkBody.md)
- [AdminUpdateIdentityBody](docs/AdminUpdateIdentityBody.md)
- [AuthenticateOKBody](docs/AuthenticateOKBody.md)
- [AuthenticatorAssuranceLevel](docs/AuthenticatorAssuranceLevel.md)
- [ContainerChangeResponseItem](docs/ContainerChangeResponseItem.md)
- [ContainerCreateCreatedBody](docs/ContainerCreateCreatedBody.md)
- [ContainerTopOKBody](docs/ContainerTopOKBody.md)
- [ContainerUpdateOKBody](docs/ContainerUpdateOKBody.md)
- [ContainerWaitOKBody](docs/ContainerWaitOKBody.md)
- [ContainerWaitOKBodyError](docs/ContainerWaitOKBodyError.md)
- [ErrorResponse](docs/ErrorResponse.md)
- [GenericError](docs/GenericError.md)
- [GraphDriverData](docs/GraphDriverData.md)
- [HealthNotReadyStatus](docs/HealthNotReadyStatus.md)
- [HealthStatus](docs/HealthStatus.md)
- [IdResponse](docs/IdResponse.md)
- [Identity](docs/Identity.md)
- [IdentityCredentials](docs/IdentityCredentials.md)
- [IdentitySchema](docs/IdentitySchema.md)
- [IdentityCredentialsType](docs/IdentityCredentialsType.md)
- [IdentityState](docs/IdentityState.md)
- [ImageDeleteResponseItem](docs/ImageDeleteResponseItem.md)
- [ImageSummary](docs/ImageSummary.md)
- [InlineResponse200](docs/InlineResponse200.md)
- [InlineResponse2001](docs/InlineResponse2001.md)
- [InlineResponse503](docs/InlineResponse503.md)
- [JsonError](docs/JsonError.md)
- [Meta](docs/Meta.md)
- [Plugin](docs/Plugin.md)
- [PluginConfig](docs/PluginConfig.md)
- [PluginConfigArgs](docs/PluginConfigArgs.md)
- [PluginConfigInterface](docs/PluginConfigInterface.md)
- [PluginConfigLinux](docs/PluginConfigLinux.md)
- [PluginConfigNetwork](docs/PluginConfigNetwork.md)
- [PluginConfigRootfs](docs/PluginConfigRootfs.md)
- [PluginConfigUser](docs/PluginConfigUser.md)
- [PluginDevice](docs/PluginDevice.md)
- [PluginEnv](docs/PluginEnv.md)
- [PluginInterfaceType](docs/PluginInterfaceType.md)
- [PluginMount](docs/PluginMount.md)
- [PluginSettings](docs/PluginSettings.md)
- [Port](docs/Port.md)
- [RecoveryAddress](docs/RecoveryAddress.md)
- [SelfServiceError](docs/SelfServiceError.md)
- [SelfServiceLoginFlow](docs/SelfServiceLoginFlow.md)
Expand All @@ -152,14 +177,15 @@ Class | Method | HTTP request | Description
- [SelfServiceSettingsFlowState](docs/SelfServiceSettingsFlowState.md)
- [SelfServiceVerificationFlow](docs/SelfServiceVerificationFlow.md)
- [SelfServiceVerificationFlowState](docs/SelfServiceVerificationFlowState.md)
- [ServiceUpdateResponse](docs/ServiceUpdateResponse.md)
- [Session](docs/Session.md)
- [SessionAuthenticationMethod](docs/SessionAuthenticationMethod.md)
- [SessionDevice](docs/SessionDevice.md)
- [SettingsProfileFormConfig](docs/SettingsProfileFormConfig.md)
- [SubmitSelfServiceLoginFlowBody](docs/SubmitSelfServiceLoginFlowBody.md)
- [SubmitSelfServiceLoginFlowWithOidcMethodBody](docs/SubmitSelfServiceLoginFlowWithOidcMethodBody.md)
- [SubmitSelfServiceLoginFlowWithPasswordMethodBody](docs/SubmitSelfServiceLoginFlowWithPasswordMethodBody.md)
- [SubmitSelfServiceLoginFlowWithTOTPMethodBody](docs/SubmitSelfServiceLoginFlowWithTOTPMethodBody.md)
- [SubmitSelfServiceLoginFlowWithTotpMethodBody](docs/SubmitSelfServiceLoginFlowWithTotpMethodBody.md)
- [SubmitSelfServiceLogoutFlowWithoutBrowserBody](docs/SubmitSelfServiceLogoutFlowWithoutBrowserBody.md)
- [SubmitSelfServiceRecoveryFlowBody](docs/SubmitSelfServiceRecoveryFlowBody.md)
- [SubmitSelfServiceRecoveryFlowWithLinkMethodBody](docs/SubmitSelfServiceRecoveryFlowWithLinkMethodBody.md)
Expand All @@ -170,7 +196,7 @@ Class | Method | HTTP request | Description
- [SubmitSelfServiceSettingsFlowWithOidcMethodBody](docs/SubmitSelfServiceSettingsFlowWithOidcMethodBody.md)
- [SubmitSelfServiceSettingsFlowWithPasswordMethodBody](docs/SubmitSelfServiceSettingsFlowWithPasswordMethodBody.md)
- [SubmitSelfServiceSettingsFlowWithProfileMethodBody](docs/SubmitSelfServiceSettingsFlowWithProfileMethodBody.md)
- [SubmitSelfServiceSettingsFlowWithTOTPMethodBody](docs/SubmitSelfServiceSettingsFlowWithTOTPMethodBody.md)
- [SubmitSelfServiceSettingsFlowWithTotpMethodBody](docs/SubmitSelfServiceSettingsFlowWithTotpMethodBody.md)
- [SubmitSelfServiceVerificationFlowBody](docs/SubmitSelfServiceVerificationFlowBody.md)
- [SubmitSelfServiceVerificationFlowWithLinkMethodBody](docs/SubmitSelfServiceVerificationFlowWithLinkMethodBody.md)
- [SuccessfulSelfServiceLoginWithoutBrowser](docs/SuccessfulSelfServiceLoginWithoutBrowser.md)
Expand All @@ -186,6 +212,8 @@ Class | Method | HTTP request | Description
- [UiText](docs/UiText.md)
- [VerifiableIdentityAddress](docs/VerifiableIdentityAddress.md)
- [Version](docs/Version.md)
- [Volume](docs/Volume.md)
- [VolumeUsageData](docs/VolumeUsageData.md)


## Documentation For Authorization
Expand Down

0 comments on commit c4d8516

Please sign in to comment.